Question: Assignment Compute Test Score Grades using array of Structures You are asked to write a program that will compute the grades for each students test

Assignment Compute Test Score Grades using array of Structures

You are asked to write a program that will compute the grades for each students test score, number of students passed the score and the test score average. Test scores and grades will be stored in an array of structures-students. The score average is rounded to one digit after decimal point.

There are 5 students and NUM_STUDENTS is defined as a constant.

The element of the array-students has the following members:

struct studentInfo {

string id;

int score;

char grade;

};

studentInfo students[NUM_STUDENTS]; //array of structures declaration

The grades are assigned based on the following table.

Score Grade

90 - 100 A

80 - 89 B

70 - 79 C

60 - 69 D

0 - 59 F

Use the following functions to perform different tasks.

//Function getScore is used to enter student id, test score

getData (students, NUM_STUDENTS);

//Function computeGrade will determine the grade for each student and store the grade

computeGrade (students, NUM_STUDENTS);

//Function pass will determine and return the number of passing scores.

//A score greater than or equal to 60 is considered a passing score.

numberPasses = pass (students, NUM_STUDENTS);

//Function findAverage will compute average of test scores and return the test score //average

averageScore = find_Average (students, NUM_STUDENTS);

//Function printSummary will print the output as shown.

printSummary (students, numberPasses, averageScore, NUM_STUDENTS);

The output will be displayed as follows:

ID Score Grade

123 90 A

345 60 D

333 70 C

678 59 F

555 87 B

Number of students passed the test: 4

The test score average: 73.2 (rounded to one digit after decimal point)

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!