Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please code in python & simplest form! Please show how to import the file. csv file: AutoSave OFF Chapter 08 Monthly Sales ang Home Insert
Please code in python & simplest form! Please show how to import the file.
csv file:
AutoSave OFF Chapter 08 Monthly Sales ang Home Insert Draw Design Layout References Mailings Review View Share Comments Chapter 08 Monthly Sales Add exception handling to the Charter 07 program that rcads the sales for 12 months from a filc and calculates the total ycarly sales as well as the average monthly sales. Monthly sales program COMMAND MENU monthly - View monthly sales yearly - View yearly summary edit - Edit sales for a month - Exit program Command: monthly Jan - 616 Feb - 466 Mar - 796 Apr - 238 May - 310 Jun - 726 Jul - 987 Aug - 604 Sep - 951 Oct - 958 Nov - 238 Dec - NA Command: yearly Using sales amount of O for Dec. Yearly total: 6990 Monthly average: 574.17 Command: edit Three-letter Month: Nos Invalid three-letter month Command: edit Three-letter Month: Nov Sales Amount: 354 Sales amount for Nov was modified Console Specifications If the program can't find the CSV file when it starts, display an error message, and exit the program. Iss these file named mantar pelas suthat contains the month and roles date shown abous 493 words English (United States) Focus E + 130% AutoSave OFF Chapter 08 Monthly Sales asg Home Insert References Mailings Review View Share Comments UBEH- Draw Design Layout Zug - 60Z Sep - 951 Oct - 958 Nov - 238 Dec - NA Comand: yearly Using sales amount of O for Dec. Yearly total: 6990 Monthly average: 574.17 Command: edat Three-letter Month: Nog Invalid three-letter month. Command: edit Three-letter Month: Nov Sales Amount: 354 Sales amount for Nov was modified Console Specifications If the program can't find the CSV file when it starts, display an error message, and exit the program. Use the CSV file named monthly_sales.csv that contains the month and sales data shown above. Write a function to open file and read the CSV file. This function will not have a parameter. Each row in the file will be turned into a list that holds the month and sales value for the month. Each row list will be added to a list that is returned by the function. Create a function that saves the monthly sales list to the CSV file. This function will take a list as a parameter. Create functions for the monthly, ycarly, and edit commands. The functions will take the sales list as an input parameter. Call cach fimction from an if statement in the main method. The main method will call the function that reads the file to store the list of lists in the monthly sales list The edit function will call the function that writes to the CSV file immediately after any change to the list are completed. The yearly function will dynarnically calculate the average based on the total of all sales values in the list and the length of the list. Round the results of the monthly average to a maximum of 2 decimal digits. Formatting is not required. In the yearly function, if the sales list doesn't contain a valid integer for the sales amount for any month, use a value of 0 for that month when calculating the total sales for the year. Display a me the user when this happens. The edit function will ask the user for the three-letter month and sales value and make a simple list of these two values. This simple new list will replace the current single month list in the sales For the cdit function, display an error message if the user doesn't enter a valid thrcc-letter abbreviation for the month. Use the following list as the standard abbreviations, months - ['Jan', 'Feb', 'Mar', 'Apr', May', 'Jun', 'Jul', 'Aug', 'Sep. 'Oct', 'Nov', 'Dec] 293 words LE English United States) Focus E + 130% T Tv 125% View Zoom Add Category Insert Table Chart Taxt Shape Media Comment Collaborate Format Organize + monthly sales.csv Sheet Sheet Name monthly sales.csv monthly s Jan 616 Feb 466 Background Mar 796 Apr 238 Duplicate Sheet May 310 Jun 726 Delete Sheet Jul 987 Aug 604 Sep 951 Oct 958 Nov 238 Dec 610Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started