Question: studInfo 1 a . txt ( input file ) Smith 7 0 7 0 8 0 7 5 Jones 8 0 7 6 9 8

studInfo1a.txt(input file)
Smith 70708075
Jones 80769882
Wilson 90879598
Michaels 77803055
Gray 60706276
Thomas 60605065
Write and fully test a Python program that will display a menu and work accordingly. Each of the menu choices should call a function to complete the task. See sample output below for the menu (data shown below may differ from your input file).
The main program should be set up as follows:
Call a function to print the description, no inputs or outputs
Call a function to print the menu, validate input of menu choice, and return an integer menu
choice; no inputs (see Sample Output for menu example)
Use a loop structure to continue offering/displaying the menu until Exit is chosen; inside the loop, use selection statements for the menu items:
Choice 1 to ask user for name of file from which to read grades: call a function with no input arguments to read in the information from the file. The function should ask the user for the file name and use try/except to open the file if the name is valid or print an error message otherwise. File includes information for several students, one per line (review input file for number of students). Each line contains the following information separated by a space: name, grade 1, grade 2,...(number of grades varies, review input file). Function should return the list created by the reading of the file.
Choice 2 to extract the data that was read in from the file; require that choice 1 has been completed first. Pass the list created by the file read in a call to a function to create a dictionary with names as keys and a list of grades as values for each key:value pair. Function should return the dictionary; dictionary should have one key:value pair for each student. Main program should print dictionary as shown in sample output.
Choice 3 to calculate and print a table of names and averages: require that choices 1 and 2 have been completed first. Pass the dictionary as an argument in a call to a function to create a 2d list of names and the average of the grades for that student. Function should return the 2d list. The main program should print a table of names and averages as shown in the Sample Output below
131- EXAM 3: Question 1A
Choice 4 to sort and print a table of names and averages: require that choices 1,2, and 3 have been completed first. Pass the 2d list of names and averages as an argument in a call to a function to create a new 2d list of names and averages that have been sorted by averages (make sure to keep the right name with the right average!). Then it should return the new 2d list. The main program should print a table of names and averages sorted by averages as shown in the Sample Output below.
Choice 5 to search the 2d list for a given name: require that choices 1,2, and 3 have been completed first. Ask the user for the name of the student. Pass the student name and the 2d list of names and averages as arguments in a call to a function to search for the given name. Function should return the index of the row of the found student name. Main program should print the name and average for the student with appropriate text. If name was not found, print a message stating this.
Choice 6 to exit the loop. Print a final statement thanking the user.
Include the following functions (see above for the inputs and outputs):
description()
menu()
read file()
extract data()
create list()
create_sort()
search list()
Remember the following:
Use incremental programming - get it to work piece by piece!
Include comments throughout the program.
Include inputs and outputs for each function as described above.
Complete tasks in main program as specified above.
Include table and decimal formatting as shown below in Sample Output.
Display the menu after each selection is complete.
Include a full

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 Programming Questions!