
You will create the following menu
Menu
- Create text file
- Sum of Numbers
- Average of Numbers
- Exit
Program
Enter your choice:
If a user enters a value other than 1 thru 4 make them renter a correct value
Details about each menu option:
- Create Text File
Ask the user to enter values and then write each value to a text file called numbers.txt. User is required to enter a minimum of 5 numbers.
After entering 5 numbers, user should be given a choice to enter more.
Numbers entered here will be used this in choices # 2 and 3 of this program.
2 Sum of Numbers
Program should read content of the text file created in step 1. Display file content in a tabular format, example shown below. Notice that the very last line displayed contains the Sum of the numbers the file contains.
Number
------------
12
3
10
2
22
-----------
Sum : 49
Design the code to handle exceptions. If file numbers.txt has not been created yet, display an appropriate message that notifies the user that file does not exit. Make sure to do this through exception handling
- Average of Numbers
Calculate the average of the numbers in the text file numbers.txt and display this results similar to what requested for Sum of Numbers in option 2 above.
Design the code to handle exceptions. If file numbers.txt has not been created yet, display an appropriate message that notifies the user that file does not exit. Make sure to do this through exception handling
- Exit Program
4 will exit your program. Only the number 4

Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 4 images

- You can Hyperlink the fileA) Pressing the Ctrl+EnterB) Pressing Ctrl+Shift+EnterC) Break command from the view menuD) Both A and Carrow_forwardYou will create the following menu Menu Create text file Sum of Numbers Average of Numbers Exit Program Enter your choice: If a user enters a value other than 1 thru 4 make them renter a correct value Details about each menu option: Create Text File Ask the user to enter values and then write each value to a text file called numbers.txt. User is required to enter a minimum of 5 numbers. After entering 5 numbers, user should be given a choice to enter more. Numbers entered here will be used this in choices # 2 and 3 of this program. 2 Sum of Numbers Program should read content of the text file created in step 1. Display file content in a tabular format, example shown below. Notice that the very last line displayed contains the Sum of the numbers the file contains. Number------------ 12 3 10 2 22 ----------- Sum : 49 PYTHON FULL CODEarrow_forwardMenu option B -- Determine GradeThe program will READ in data from a text file named Grades.txt. The user corrects any bad data. The program updates the information in Grades.txt file. For example, if the file contains 55 credits which exceeds the max credits you can take during one semester. You will create and submit a text file with a minimum of 5 records in addition to the example below. The file is named Grades.txt and contains the following format: first line full namesecond line number of creditsthird line study hours Such asPatrick Mahomes1236DesHAun waTson9appledrew BrEeS5515JULIO JONES1545 The program determines the grade, assuming it’s the same grade for each classAll data must be displayed in proper case such as Wendy Payne, i.e. no names should be in all lower case or all upper case or a mix such as wendy or PaYNe. Use module(s) to convert to proper case.The program displays the student’s name, number of credits, total weekly study hours, and desired gradeThe information…arrow_forward
- BAGGINS Trucking maintains a trip file in which each record contains the following data:DRIVER nameMILES driven on tripHOURS driven on trip Design an application that inputs records from the file (until reaching "eof") and, for each record, displays the DRIVER's name and the average Miles-per-Hours (MPH) for the trip where MPH is calculated by dividing the MILES by the HOURS. The program should also accumulate a GRAND total of the MILES driven. At the end, the program should display the GRAND total of the MILES driven. For example, if the trip file contained the following:Smith, 300, 5Williams, 750, 10Jones, 880, 11 then the program should display:Smith averaged 60 mphWilliams averaged 75 mphJones averaged 80 mphGrand total of miles is 1,930 Pseudocode:arrow_forwardPython Programming You will create the following menu Menu Create text file Average Values Total Values Exit Program Enter your choice: If a user enters a value other than 1 thru 4 make them renter a correct value Details about each menu option: Create Text File Ask the user to enter values and then write each value to a text file called numbers.txt. User is required to enter a minimum of 5 numbers. After entering 5 numbers, user should be given a choice to enter more. Numbers entered here will be used this in choices # 2 and 3 of this program. 2. Average Values Average the values in the text file numbers.txt and display this value to the screen. Make sure to give an appropriate message Design the code to handle exceptions. If file numbers.txt has not been created yet, display an appropriate message that notifies the user that file does not exit. Make sure to do this through exception handling 3. Total Values Total the values in the numbers.txt file and display the value to the…arrow_forwardWhen a file’s header is not located and the extension is not know the file is reported as a(n) ____. alias unknown Bad Signature non-conventionalarrow_forward
- The _____ option on an application file menu allows you to save the latest version of a file under its current name and its current location. a) backspace b) save as c) save d) deletearrow_forwardIt is recommended to use a ‘with’ statement when opening files so that ____.arrow_forwardC programarrow_forward
- Sample Run 2: Enter the symbol to draw the shapes: # Enter the width of the shape: 4 Enter the height of the shape: 6 #### ## ### ## Save the file as cla14.py by clicking on File on the menu bar, then click on "Save as .". Type in cla14.py as the file name in the save as dialog box. • Run your program: Hit function key to execute the program. Alternatively you can click on Run on the menu bar and select "Run Module". • If you have any errors, fix them, save the changes in the file window, and re-run the program ()arrow_forwardFile Display Assume that a file containing a series of integers is named numbers.dat and exists on the computer’s disk. Design a program that displays all of the numbers in the file. File Display IN Q Basic langauage and flowchartarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





