Create a program that allows you to view and edit the sales amounts for each month of the current year. Can you PLEASE make sure the ADD command works where the user can input the command data for a given month. Console Monthly Sales program COMMAND MENU add - Add sales for specified month view - View sales for specified month edit - Edit sales for specified month totals - View sales summary for year exit - Exit program Command: add Three-letter Month: jan Sales Amount: 10317 Sales amount for Jan is 10,317.00. Command: add Three-letter Month: feb Sales Amount: 15293 Sales amount for Jan is 15,293.00. Command: view Three-letter Month: jan Sales Amount: 14317 Sales amount for Jan is 14,317.00. Command: edit Three-letter Month: jan Sales amount for Jan is 14,317.00. Command: totals Yearly total: 29,610.00 Monthly average: 14,805.00 Command: view Three-letter Month: july Invalid three-letter month. Command: exit Bye! MUST HAVE REQUIREMENTS The program should use a list to store the sales data for each month with the three-letter abbreviation for the month (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, and Dec) as the key for each item. When the program starts, it should read the sales data inserted from the user. If the user edits the sales data, the program should edit the data If the user selects total, the program should calculate the total sales and average monthly sales. Use functions to view sales, edit sales, calculate total, and calculate average.
Create a program that allows you to view and edit the sales amounts for each month of the current year. Can you PLEASE make sure the ADD command works where the user can input the command data for a given month. Console Monthly Sales program COMMAND MENU add - Add sales for specified month view - View sales for specified month edit - Edit sales for specified month totals - View sales summary for year exit - Exit program Command: add Three-letter Month: jan Sales Amount: 10317 Sales amount for Jan is 10,317.00. Command: add Three-letter Month: feb Sales Amount: 15293 Sales amount for Jan is 15,293.00. Command: view Three-letter Month: jan Sales Amount: 14317 Sales amount for Jan is 14,317.00. Command: edit Three-letter Month: jan Sales amount for Jan is 14,317.00. Command: totals Yearly total: 29,610.00 Monthly average: 14,805.00 Command: view Three-letter Month: july Invalid three-letter month. Command: exit Bye! MUST HAVE REQUIREMENTS The program should use a list to store the sales data for each month with the three-letter abbreviation for the month (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, and Dec) as the key for each item. When the program starts, it should read the sales data inserted from the user. If the user edits the sales data, the program should edit the data If the user selects total, the program should calculate the total sales and average monthly sales. Use functions to view sales, edit sales, calculate total, and calculate average.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Create a program that allows you to view and edit the sales amounts for each month of the current year.
Can you PLEASE make sure the ADD command works where the user can input the command data for a given month.
Console
Monthly Sales program
COMMAND MENU
add - Add sales for specified month
view - View sales for specified month
edit - Edit sales for specified month
totals - View sales summary for year
exit - Exit program
Command: add
Three-letter Month: jan
Sales Amount: 10317
Sales amount for Jan is 10,317.00.
Command: add
Three-letter Month: feb
Sales Amount: 15293
Sales amount for Jan is 15,293.00.
Command: view
Three-letter Month: jan
Sales Amount: 14317
Sales amount for Jan is 14,317.00.
Command: edit
Three-letter Month: jan
Sales amount for Jan is 14,317.00.
Command: totals
Yearly total: 29,610.00
Monthly average: 14,805.00
Command: view
Three-letter Month: july
Invalid three-letter month.
Command: exit
Bye!
MUST HAVE REQUIREMENTS
- The program should use a list to store the sales data for each month with the three-letter abbreviation for the month (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, and Dec) as the key for each item.
- When the program starts, it should read the sales data inserted from the user.
- If the user edits the sales data, the program should edit the data
- If the user selects total, the program should calculate the total sales and average monthly sales.
- Use functions to view sales, edit sales, calculate total, and calculate average.
Expert Solution
Step 1
Monthly Sales program COMMAND MENU view  - View sales for specified month edit  - Edit sales for specified month totals - View sales summary for year exit  - Exit program Command: view Three-letter Month: Jan Sales amount for Jan is 616.00. Command: edit Three-letter Month: Jan Sales Amount: 651 Sales amount for Jan is 651.00. |
Command: view Three-letter Month: July Invalid three-letter month. Command: exit Bye! |
Console
    Command: totals |
|
    Yearly total: |
7,535.00 |
    Monthly average: |
627.92 |
Specifications
- Use the text file named monthly_sales.txt that consists of tab delimited rows, where the rows contain three-letter abbreviations for the month and the monthly sales. Create a module level constant to hold the name of the text file.
- The program should contain a function that reads the file and store the sales data for each month in a dictionary with the month abbreviation as the key for each sales value item. For each line of text in the file remove the new line character and split the tab delimited row into a list that is used to create the dictionary elements. The function will return the dictionary of all key/value elements.
- The program should contain a function that writes the dictionary values to the file. The dictionary will be passed to the function as a parameter. For each month and sales amount key value pair in the dictionary write a tab separated line to the text file.
- Whenever the sales data is edited, the program should write the changed data to the text file.
- When viewing or editing a month, check if the input month is a valid key in the dictionary and display a message if the three-letter month is not valid.
- Use functions to organize the code for each of the commands.
Monthly_sales.txt
Jul 9762
Dec 2497
May 2429
Mar 1073
Apr 3463
Oct 6735
Aug 15578
Jun 4324
Feb 4176
Nov 88
Jan 15293
Sep 2437
code in python please
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY