Question: Using the following parallel arrays: const int NUM_STUDENTS =3; const int NUM_GRADES =5; string Students[NUM_STUDENTS] = {Tom,Jane,Jo}; int grades[NUM_STUDENTS][NUM_GRADES] ={{78,98,88,99,77}, {62,99,94,85,93}, {73,82,88,85,78}}; Write a C++

Using the following parallel arrays:

const int NUM_STUDENTS =3; const int NUM_GRADES =5; string Students[NUM_STUDENTS] = {"Tom","Jane","Jo"}; int grades[NUM_STUDENTS][NUM_GRADES] ={{78,98,88,99,77}, {62,99,94,85,93}, {73,82,88,85,78}};

Write a C++ program to run a menu-driven program with the following choices:

1) Display the grades 2) Adjust grade 3) Display Average for each assignment 4) Display student with Highest grade for each assignment

5) Quit

Make sure your program conforms to the following requirements:

2. Write a function called getValidGrade that allows a user to enter in an integer and loops until a valid number that is >= 0 and <= 100 is entered. It returns the valid value. (5 points).

3. Write a function called getValidStudentNumber that allows a user to enter in an integer and loops until a valid number that is >= 1 and <= NUM_STUDENTS is entered. It returns the valid value. (5 points). (NOTE- the user understands the first student as student 1 but the array element is 0)

4. Write a function called getValidAssignmentNumber that allows a user to enter in an integer and loops until a valid number that is >= 1 and <= NUM_GRADES is entered. It returns the valid value. (5 points). (NOTE- the user understands the first assignment as assignment 1 but the array element is 0)

5. Write a function called displayGrades that takes the student and grade arrays as parameters and displays the grades in the format in the sample run below. (15 points).

6. Write a function called displayAverageForEachAssignment that takes the student and grade arrays as parameters, computes the average grade for each assignment, and displays the grades in the format in the sample run below. (25 points).

7. Write a function called displayStudentHighestGradeForSelectedAssignment that takes the student and grade arrays as parameters, allows the user to select a valid assignment and locates and displays the name of the student with the highest grade for that assignment in the format in the sample run below. (25 points).

8. Write a function called AdjustGrade that takes grade arrays as a pass by reference parameter, allows the user to select a valid student, a valid assignment, and a valid grade and changes the student assignment grade to the value entered (15 points).

9. Add comments wherever necessary. (5 points)

Sample Run:

NOTE: not all possible runs are shown below.

Welcome to the help with the grading program! 1) Display the grades 2) Adjust grade 3) Display Average for each Assignment 4) Display the name of the student with the highest grade 5) Quit Select an option (1..5)..1 Name Assign. 1 Assign. 2 Assign. 3 Assign. 4 Assign. 5 Tom 78 98 88 99 77 Jane 62 99 94 85 93 Jo 73 82 88 85 78 1) Display the grades 2) Adjust grade 3) Display Average for each Assignment 4) Display the name of the student with the highest grade 5) Quit Select an option (1..5)..7 Select an option (1..5)..2 Adjust Grade Please enter in the student number... 0 Please enter in a valid student number... 1 Please enter in an assignment number... 1 Please enter in the grade... 33 Grade changed 1) Display the grades 2) Adjust grade 3) Display Average for each Assignment 4) Display the name of the student with the highest grade 5) Quit Select an option (1..5)..1 Name Assign. 1 Assign. 2 Assign. 3 Assign. 4 Assign. 5 Tom 33 98 88 99 77 Jane 62 99 94 85 93 Jo 73 82 88 85 78 1) Display the grades 2) Adjust grade 3) Display Average for each Assignment 4) Display the name of the student with the highest grade 5) Quit Select an option (1..5)..2 Adjust Grade Please enter in the student number... 0 Please enter in a valid student number... 2 Please enter in an assignment number... 0 Please enter in a valid assignment number... 1 Please enter in the grade... -9 Please enter in a valid grade... 106 Please enter in a valid grade... 55 Grade changed 1) Display the grades 2) Adjust grade 3) Display Average for each Assignment 4) Display the name of the student with the highest grade 5) Quit Select an option (1..5)..2 Adjust Grade Please enter in the student number... 2 Please enter in an assignment number... 2 Please enter in the grade... 88 Grade changed 1) Display the grades 2) Adjust grade 3) Display Average for each Assignment 4) Display the name of the student with the highest grade 5) Quit Select an option (1..5)..1 Name Assign. 1 Assign. 2 Assign. 3 Assign. 4 Assign. 5 Tom 33 98 88 99 77 Jane 55 88 94 85 93 Jo 73 82 88 85 78 1) Display the grades 2) Adjust grade 3) Display Average for each Assignment 4) Display the name of the student with the highest grade 5) Quit Select an option (1..5)..3 Average grade for each assignment Average assignment1: 53.6667 Average assignment2: 89.3333 Average assignment3: 90 Average assignment4: 89.6667 Average assignment5: 82.6667 1) Display the grades 2) Adjust grade 3) Display Average for each Assignment 4) Display the name of the student with the highest grade 5) Quit Select an option (1..5)..4 Student with highest grade Please enter in an assignment number... 0 Please enter in a valid assignment number... 2 Tom had the highest grade on assignment 2 1) Display the grades 2) Adjust grade 3) Display Average for each Assignment 4) Display the name of the student with the highest grade 5) Quit Select an option (1..5)..4 Student with highest grade Please enter in an assignment number... 5 Jane had the highest grade on assignment 5 1) Display the grades 2) Adjust grade 3) Display Average for each Assignment 4) Display the name of the student with the highest grade 5) Quit Select an option (1..5)..5

Process finished with exit code 0

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