Question
Using Python:Your assignment is to write a program that automates an instructor's grade book. This program processes commands to add student names, record and alter
Using Python:Your assignment is to write a program that automates an instructor's grade book. This program processes commands to add student names, record and alter scores, calculate a final semester score and print out the student information in different orders. The instructor (the user) interacts with the program through a simple command-based user interface.
Input 1. The retained student information, generated in previous executions of this program, is input from file "Grades.dat" at the beginning of each execution of the program. 2. The commands from the instructor are input (in response to "user-friendly" prompts from the program) as single letters. The commands are discussed in detail in the Processing instructions below.
Output 3. Responses to user commands are to be written to the screen, as described in the Processing instructions below. 4. The output from command O (Output) should be printed to file "Grades.out", as described in the Processing instructions below. 5. The updated grade information must be saved to file "Grades.dat".
Processing The user commands are printed to the screen as a menu, and the user responds with a single-letter command. Some commands require the program to prompt the user to enter additional information. After each command is processed, the menu should be redisplayed. The commands are to be processed as described in the following table:
Command Description
S Set up for new semester. The program must prompt the user for the number of programming assignments (range 0 .. 6), the number of tests (range 0 .. 4), and final mid (range 0 .. 1). It must also prompt the user for the relative weights of programs, tests, and final mid in determining the students' grades. The relative weights are expressed as percentages of the semester grade, and must add up to 100%. The information will be saved to a separate file called policy.
A Add a student. The program must prompt student's ID (integer in the range 1 - 9999), and the user for the student's name (last name and first name, strings of at most 20 characters).
P Record programming assignment score for all students. The program must prompt the user to ask which assignment number is to be recorded. Upon receiving a valid assignment number, the program will prompt the user with each student's name and ID.
T Record test score for all students. The program must prompt the user to ask which test is to be recorded. Upon receiving a valid test number, the program will prompt the user with each student's name and ID.
F Record Final mid score for all students. The program must prompt the user
with each student's name and ID.
C Change a grade for a particular student. The program must prompt the user to get the student ID, the new score, and the type of score to change (P, T, or F, as described above). Upon receiving valid information, the program will also prompt the user to enter assignment number, test number, or mid number depending on the type of score.
G Calculate final score. Add the program scores, test scores and final mid scores according their weights for each student. And store the final score in the student's record.
O Output the grade data, ordered alphabetically by name (last name) or by student's ID (in increasing order). The name, student's ID, assignment score(s), test score(s), final mid score(s), and the final score must be printed out in the order indicated, to file "Grades.out". Format the data with appropriate labels.
Q Quit. Save all the student record data to the "Grades.dat" file, and terminate
the program.
The S (Setup) command must be made (once per semester) before any of the other commands can be executed. If this command is made in a particular execution of the program, the "Grades.dat" input file should be ignored, and the grades data structure should be initialized to the empty state.
save file for semester is policy
save file for score is grade_score
output file for score is grade_output
don't worry about the driver function
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started