Question: Page 2 of 5 Program # 0 1 : Create a program that reads the sales for 1 2 months from a file and calculates
Page of
Program #:
Create a program that reads the sales for months from a file and calculates the total yearly sales as
well as the average monthly sales. In addition, this program should let the user edit the sales for any
month.
Console:
Monthly Sales program
COMMAND MENU
monthly View monthly sales
yearly View yearly summary
edit Edit sales for a month
exit Exit program
Command: monthly
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
Command: yearly
Yearly total:
Monthly average:
Command: edit
Threeletter Month: Nov
Sales Amount:
Sales amount for Nov was modified.
Command: exit
Bye!
Specifications
Use a CSV file named monthlysales.csv that contains the month and sales data shown above.
For the edit command, display an error message if the user doesnt enter a valid threeletter
abbreviation for the month.
When the user edits the sales amount for a month, the data should be saved to the CSV file
immediately. That way, no data is lost, even if the program crashes later.
Round the results of the monthly average to a maximum of decimal digits.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
