Question: Write a program that reads the amount of coins collected at the end of each day of a month in a local supermarket and
Write a program that reads the amount of coins collected at the end of each day of a month in a local supermarket and calculates the total amount in fils (1 AED = 100 fils). The program reads the data for the entire month from the file coins.txt (assume the month has 30 days). The input file has one line for each day where each line has: number of fils, space, number of 5-fils, space, number of 10-fils, space, number of 25-fils, space, and number of 50-fils. Make sure that the total amount is displayed with exactly two decimals. For the sake of testing your program consider an input file where the first 29 lines, each contains 00000 and the last line are 1 1 1 1 1. This means the file is for a month where no coins where collected in the first 29 days. The output should be 0.91 AED. Now if you test your program for having 0 0 000 for the first 28 days and for the last 2 days, we have: 77 117 430 705 520 89 320 414 833 850 Then the answer is shown below: Sample run (with the above file): Total amount collected is: AED 1178.32 Process returned 0 (0xe) execution time: 0.263 s Press any key to continue.
Step by Step Solution
3.29 Rating (158 Votes )
There are 3 Steps involved in it
Python implementation of the program def readinput Reads the input file and returns a list of lists ... View full answer
Get step-by-step solutions from verified subject matter experts
