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 2 of 5
Program #01:
Create a program that reads the sales for 12 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 -14317
Feb -3903
Mar -1073
Apr -3463
May -2429
Jun -4324
Jul -9762
Aug -15578
Sep -2437
Oct -6735
Nov -88
Dec -2497
Command: yearly
Yearly total: 66606
Monthly average: 5550.5
Command: edit
Three-letter Month: Nov
Sales Amount: 8854
Sales amount for Nov was modified.
Command: exit
Bye!
Specifications
Use a CSV file named monthly_sales.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 three-letter
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 2 decimal digits.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!