>90 A 80 – 89.9 B 70 – 79.9 C 60 – 69.9 D <60 E After each student\'s grade is d
ID: 3618114 • Letter: #
Question
>90 A
80 – 89.9 B
70 – 79.9 C
60 – 69.9 D
<60 E
After each student's grade is determined, the program performs astatistics on the entire class by finding out how many A's, B's,C's, D's and E's in the class.
The following is a sample data file, in the order of student id,two test scores, and seven homework scores on each line:
123456789 77.2 88.3 22 28 35 45 33 35 40
234567890 97.5 90 25 30 38 48 34 35 50
345678901 82.4 77.5 22.5 27 35.5 44 35 33 48
And the following is the sample output file:
STUDENTID HW AVE TESTAVE FINALSCORE GRADE
123456789 89.8 82.8 85.6 B
234567890 98.1 93.8 95.5 A
345678901 92.5 80.0 85.0 B
Number of A's: 1
Number of B's: 2
Number of C's: 0
Number of D's: 0
Number of E's: 0
You are required to solve this problem usingarray and struct and also file I/O that were learned in thiscourse. You need declare a structure SStudent tocollectively manager each student's data, and an array of30 students to manager a class of maximum 30 students.Each student should have studentID, hwAve, testAve, finalScore,grade, an array of 2 test scores, and an array of 7 homeworkscores.
The following are functions that you must implement for the mainsteps:
int getInput ( SStudent [], int); // sendover an array of 30 students to get input for // stident id, testscores and homework scores
// return how many students wer actually read
// open input file should be done in the function
void process ( SStudent [], int); // send numberof students really stored in the array
// calculate hwAve, testAve, finalScore, and grade
// for each student on the array
void display ( cost SStudent [], int ); // send number ofstudents really stored in array
// do grade analysis and displayresult
// open output file should be done inthe function
Explanation / Answer
please rate - thanks #include #include #include using namespace std; struct SStudent{ int studentID; double hwAve; double testAve; double finalScore; char grade; double tests[2]; double homework[7]; } stu[30]; int getInput ( SStudent [], int); // sendover an array of 30 students to get input for // stident id, testscores and homework scores // return how many students wer actually read // open input file should be done in the function void process ( SStudent [], int); // send numberof students really stored in the array // calculate hwAve, testAve, finalScore, and grade // for each student on the array void display ( const SStudent [], int ); // send number of studentsreally stored in array // do grade analysis and displayresult // open output file should be done in thefunction int main() {int n; n=getInput ( stu,30 ); if(nstu[m].tests[i]; for(i=0;i>stu[m].homework[i]; m++; in>>stu[m].studentID; } in.close(); return m; } void process ( SStudent stu[], intn) // send numberof students really stored in the array // calculate hwAve, testAve, finalScore, and grade // for each student on the array {int i,j; double maxpoints[7]={25,30,40,50,35,35,50}; char grades[6]={'E','D','C','B','A','A'}; double tot; for(i=0;iRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.