Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include #include GradeBook.cpp int main () { char command; std :: cout enter a letter std:: endl ; std :: cin >>command; if (command ==

#include #include "GradeBook.cpp"int main() { char command; std::cout "enter a letter" std::endl; std::cin>>command; if (command == 's') { GradeBook NewBook; NewBook.Setup(); while (command != 'q') { std::cout "enter a letter" std::endl; std::cin>>command; if (command == 'a') { NewBook.AddStudent(); } } }}

image text in transcribedimage text in transcribed
Processing The user commands are printed to the screen as a menu, and the user responds with a singleletter comlnand. 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 INSTRUCTIONS 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 nal exams (range 0 .. 1). It must also prompt the user for the relative weights of programs, tests, and nal exam in determining the students' grades. The relative weights are expressed as percentages of the semester grade, and must add up to 100%. Add a student. The program must prompt the user for the student's name (last name and first name, strings of at most 20 characters), and student number (integer in the range 1 - 9999). Record programming assignment grade for all students. The program must prompt the user to ask which program number is to be recorded. Upon receiving a valid program number, the program must prompt the user with each student's name (processing them alphabetically), at which time the user inputs the program grade for that student. A valid program number is one that is less than numPrograms, and that has not been previously recorded. If the program number is not valid, print an appropriate error message. Record test grade for all students. The program must prompt the user to ask which test number is to be recorded. Upon receiving a valid test number, the program must prompt the user with each student's name (processing them alphabetically), at which time the user inputs the test grade for that student. A valid test number is one that is less than numTests, and that has not been previously recorded. If the test number is not valid, print an appropriate error message. Record Final exam grade for all students. The program must prompt the user with each student's name (processing them alphabetically), at which time the user inputs the nal exam grade for that student. If nal exam grades have been previously recorded, print a message. Change a grade for a particular student. The program must prompt the user to get the student number, the new grade, and the type of grade to change (P, T, or F, as described above). Calculate nal grade. Add the program grades for each student and store the average in the student's record. Add the test grades for each student and store the average in the student's record. Output the grade data, ordered alphabetically by name (last name/rst name) or by student number (in increasing order). The name, student number, and grade book data must be printed out in the order indicated, to le "Gradesout". Format the data with appropriate labels. Quit. Save all the student record data to the "Gradesdat" le, and terminate the program

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions