Billing
InterviewTime limit1sMemory limit128 MB
Read item names until EOI and print the total cost of all listed supplies with a dollar sign and two decimals.
- Level
Easy1 of 10
- Topics
- Hash map, Implementation
- Solved
- No attempts yet
Problem
The accounting office needs to bill each department for the supplies purchased last semester. The chart below lists every supply item and its cost. Write a program that reads a list of purchased supplies and computes the total cost.
Input
The input is a list of office supplies, one item name per line. The end of the list is denoted by the string EOI. Every item name matches a name in the chart above exactly.
Output
Print the total cost of all items in the list. The output must start with a dollar sign $ and show the total with exactly two decimal digits.