Program written in Python containing: a. A main function that…
Question Answered step-by-step Program written in Python containing: a. A main function that… Program written in Python containing: a. A main function that displays a menu of choices. Menu choices are: D: Display grades C: Calculate average X: Exit application The menu will display until the user enters X to exit the application. b. A function named DisplayScores that displays scores for all items in the text file. Each score should have a line number to the left starting at 1. For example: 1: 78 2: 93. (see output example below). This function accepts zero arguments and does not return any values. This function does read from a text file, so it needs error handling for IOErrors. c. A function named CalcAverage that reads the text file, accumulates a total and divides the total by the number of items in the file. This function accepts zero arguments and returns a single value. The value returned is the class average as a result. This function does read from a text file, so it needs error handling for IOErrors and ValueErrors. d. Program includes inline documentation about each section. For example, # declare and initialize variables. e. Program is saved as Program6.py EXPECTED INPUT/OUTPUT This shows the format of the expected input/output. TEST CASES The formatted class average will return 84.37 based on the text file provided to you. You must develop your program to count the lines in the event the text file were to change. Computer Science Engineering & Technology Python Programming CIS 216 Share QuestionEmailCopy link Comments (0)


