Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

If it exists, compute lim x 0 x 3 e x 1 x 2 x 2

Answered: 1 week ago

Question

4. Explain the strengths and weaknesses of each approach.

Answered: 1 week ago