Question
C++ Code Exercise A: Gradebook1D Write an application that prints out the final grade of the students in a class and the average for the
C++ Code
Exercise A: Gradebook1D
Write an application that prints out the final grade of the students in a class and the average for the whole class. There are a total of 3 quizzes.
You will need 4 arrays:
An array of type int to store all the ID's
An array of type double to store all scores for quiz 1
An array of type double to store all scores for quiz 2
An array of type double to store all scores for quiz 3
How to proceed:
Ask the user how many students are in the class, so you can set the length of the all arrays.
Allocate 4 arrays that will store the data.
Use a FOR loop to retrieve and store all the data.
Use another FOR loop to
Output the final score for each student.
Keep track of all scores to later compute the average for the class.
Calculate and Output the average for the class.
Format all floating-point numbers to 2 decimal places.
Sample Output:
How many students in the class? 4
Enter student ID: 111
Enter score for Quiz 1: 100
Enter score for Quiz 2: 95
Enter score for Quiz 3: 90
Enter student ID: 222
Enter score for Quiz 1: 90
Enter score for Quiz 2: 85
Enter score for Quiz 3: 80
Enter student ID: 333
Enter score for Quiz 1: 100
Enter score for Quiz 2: 100
Enter score for Quiz 3: 100
Enter student ID: 444
Enter score for Quiz 1: 90
Enter score for Quiz 2: 90
Enter score for Quiz 3: 90
ID 111 - Final grade: 95.00
ID 222 - Final grade: 85.00
ID 333 - Final grade: 100.00
ID 444 - Final grade: 90.00
Class average: 92.50
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