题目描述

(Calculating Total Sales) A mail order house sells five different products whose retail prices are: product 1 — 2.98, product2—4.50, product 3—9.98, product4—4.49 and product 5—$6.87. Write a program that reads a series of pairs of numbers as follows:
a) product number b) quantity sold
Your program should use a switch statement to determine the retail price for each product. Your program should calculate and display the total retail value of all products sold. Use a sentinel-controlled loop to determine when the program should stop looping and display the final results.


输入格式

The input consists of n (0<n<100) lines.
Each line consists of the product number(ranges from 1 to 5), the quantity sold(ranges from 1 to 100).
The last line of input consists of Int(-1).


输出格式

The decimal precision of output is 2.


样例数据

输入

1 1
2 2
3 3
4 4
5 5
1 2
-1

输出

Product 1: $8.94
Product 2: $9.00
Product 3: $29.94
Product 4: $17.96
Product 5: $34.35
total: $100.19

备注


操作

评测记录

优秀代码

信息

时间限制: 1s
内存限制: 128MB
评测模式: Normal

题解