Question: studInfo 1 a . txt ( input file ) Smith 7 0 7 0 8 0 7 5 Jones 8 0 7 6 9 8
studInfoatxtinput file
Smith
Jones
Wilson
Michaels
Gray
Thomas
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 offeringdisplaying the menu until Exit is chosen; inside the loop, use selection statements for the menu items:
Choice 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 tryexcept 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 grade number of grades varies, review input file Function should return the list created by the reading of the file.
Choice to extract the data that was read in from the file; require that choice 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 to calculate and print a table of names and averages: require that choices and have been completed first. Pass the dictionary as an argument in a call to a function to create a d list of names and the average of the grades for that student. Function should return the d list. The main program should print a table of names and averages as shown in the Sample Output below
EXAM : Question A
Choice to sort and print a table of names and averages: require that choices and have been completed first. Pass the d list of names and averages as an argument in a call to a function to create a new d 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 d list. The main program should print a table of names and averages sorted by averages as shown in the Sample Output below.
Choice to search the d list for a given name: require that choices and have been completed first. Ask the user for the name of the student. Pass the student name and the d 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 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
createsort
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
