Question
Write a program in C++ that will compute each students test score, class average and Student IDs those who score over 80. The total number
Write a program in C++ that will compute each students test score, class average and Student IDs those who score over 80.
The total number of questions (NUM_Q) in the test is 50 that is defined as a constant. There are 5 students in the class and (NUM_STUDENTS) is defined as a constant.
Use the following arrays:
id - stores student id - type string
correct - stores number of correct answers - type int
incorrect - stores number of incorrect answers - type int
score - stores test score - type int
Use the following functions:
Function getData will get data - id and correct for each student and stored in two arrays id and correct.
getData (id, correct, NUM_STUSENTS);
Sample Input screen
Students ID :
Number of correct answers :
Function calculate will find out the number of incorrect answers (NUM_Q correct answers) and score (2 * number of correct answers) and those data will be stored in incorrect and score array.
calculate (correct, incorrect, score, NUM_STUDENTS);
Function findAverage function will calculate the test average of all students. The variable average is defined as type double.
average = findAverage (score, NUM_STUDENTS);
Function findHigh will find out the highest test score and return the value to the calling program.
high = findHigh (id, score, NUM_STUDENTS);
Function display will display the table with id, number of correct answers, number of incorrect answers, and score. This function will also print the average test score, highest test score and a table with id and scores those are above 80. Test score average will be displayed with 2 digits after decimal point.
display (id, correct, incorrect, score, average, high, NUM_STUDENTS);
Sample data:
ID Correct Answers
1234 40
3427 47
2020 35
3215 41
Sample Output:
ID Correct Answers Incorrect Answers Score
1234 40 10 80
3427 47 3 94
2020 35 15 70
3215 41 9 82
Test Score Average: ____
Highest Test Score: ____
Scores above 80
ID Score
3427 94
3215 82
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