Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please help me to write a c++ program to provide a report of student grades. Eac

ID: 3695668 • Letter: P

Question

Please help me to write a c++ program to provide a report of student grades. Each student is given four exams. The final grade of each student is determined by calculating the weighted average of all the exams.

weighted average = 1st grade * weight of exam 1 + 2nd grade * weight of exam 2 + 3rd grade * weight of exam 3 + 4th grade * weight of exam 4.

Your report should show the final grade of each student, the class average, and the maximum and minimum grades for the class.

The first record of the input file contains the weights (proportions) for the four exam grades. This should be read into one array. The set of data input for each student contains the following information:

-- Student's first and last name (use datatype string)
-- Student's ID
-- Grade for exam 1
-- Grade for exam 2
-- Grade for exam 3
-- Grade for exam 4

When you read each set of student grades, read it into a second array. Process one student at a time—do not read the student’s name and ID into an array, just his grades. Read the input file until there is no more data.

Use the following test data:

-- weights for exams: .10, .20, .25, .45
-- first student record: Tom Jones 101101032, 75, 87, 79, 92
-- make up the rest yourself (there should be 15 sets of grades).

It will help me if the report file output is neat and readable with appropriate headings. Thanks

Explanation / Answer

//sample data for testing

/*

.10 .20 .25 .45
Tom Jones 101101032 75 87 79 92
Student0 Studentl0 ID0 6 95 15 56
Student1 Studentl1 ID1 95 8 88 72
Student2 Studentl2 ID2 55 32 62 10
Student3 Studentl3 ID3 19 76 46 2
Student4 Studentl4 ID4 21 68 91 21
Student5 Studentl5 ID5 96 23 0 85
Student6 Studentl6 ID6 1 84 84 74
Student7 Studentl7 ID7 42 32 99 17
Student8 Studentl8 ID8 96 22 1 37
Student9 Studentl9 ID9 23 38 23 74
Student10 Studentl10 ID10 45 40 26 73
Student11 Studentl11 ID11 34 63 93 81
Student12 Studentl12 ID12 10 51 60 44
Student13 Studentl13 ID13 74 40 33 58
Student14 Studentl14 ID14 4 78 26 35
Student15 Studentl15 ID15 29 22 37 93
Student16 Studentl16 ID16 9 25 35 50
Student17 Studentl17 ID17 71 62 68 64
Student18 Studentl18 ID18 79 80 37 98
Student19 Studentl19 ID19 19 99 19 10
Student20 Studentl20 ID20 36 96 3 10
Student21 Studentl21 ID21 34 30 55 40
Student22 Studentl22 ID22 61 20 13 87
Student23 Studentl23 ID23 99 34 48 87
Student24 Studentl24 ID24 91 32 4 66
Student25 Studentl25 ID25 47 8 16 15
Student26 Studentl26 ID26 80 86 24 44
Student27 Studentl27 ID27 93 66 78 47
Student28 Studentl28 ID28 34 9 25 54
Student29 Studentl29 ID29 47 20 74 26
Student30 Studentl30 ID30 64 2 52 74
Student31 Studentl31 ID31 45 47 44 95
Student32 Studentl32 ID32 80 1 77 77
Student33 Studentl33 ID33 1 1 3 18
Student34 Studentl34 ID34 16 62 37 93
Student35 Studentl35 ID35 95 85 36 64
Student36 Studentl36 ID36 28 98 40 58
Student37 Studentl37 ID37 60 38 54 33
Student38 Studentl38 ID38 55 43 73 95
Student39 Studentl39 ID39 31 91 71 63
Student40 Studentl40 ID40 5 18 73 75
Student41 Studentl41 ID41 46 56 59 98
Student42 Studentl42 ID42 58 75 18 21
Student43 Studentl43 ID43 56 97 74 18
Student44 Studentl44 ID44 21 73 79 53
Student45 Studentl45 ID45 88 48 76 38
Student46 Studentl46 ID46 84 65 85 50
Student47 Studentl47 ID47 29 94 74 50
Student48 Studentl48 ID48 98 10 68 71
Student49 Studentl49 ID49 86 27 77 86
Student50 Studentl50 ID50 66 13 77 21
Student51 Studentl51 ID51 80 80 99 25
Student52 Studentl52 ID52 86 76 13 65
Student53 Studentl53 ID53 45 6 57 11
Student54 Studentl54 ID54 36 48 16 95
Student55 Studentl55 ID55 20 92 15 83
Student56 Studentl56 ID56 45 73 76 0
Student57 Studentl57 ID57 33 68 76 87
Student58 Studentl58 ID58 88 28 52 43
Student59 Studentl59 ID59 86 37 45 86
Student60 Studentl60 ID60 87 40 57 23
Student61 Studentl61 ID61 24 68 26 92
Student62 Studentl62 ID62 44 41 51 85
Student63 Studentl63 ID63 45 0 46 82
Student64 Studentl64 ID64 3 38 63 17
Student65 Studentl65 ID65 11 50 30 0
Student66 Studentl66 ID66 14 35 81 98
Student67 Studentl67 ID67 63 56 64 45
Student68 Studentl68 ID68 26 33 1 14
Student69 Studentl69 ID69 42 78 3 74
Student70 Studentl70 ID70 98 7 72 26
Student71 Studentl71 ID71 21 99 91 14
Student72 Studentl72 ID72 0 52 2 2
Student73 Studentl73 ID73 85 80 37 60
Student74 Studentl74 ID74 9 93 32 61
Student75 Studentl75 ID75 14 16 56 97
Student76 Studentl76 ID76 58 84 29 98
Student77 Studentl77 ID77 7 60 56 49
Student78 Studentl78 ID78 1 4 31 94
Student79 Studentl79 ID79 59 99 3 30
Student80 Studentl80 ID80 14 87 33 69
Student81 Studentl81 ID81 99 92 41 81
Student82 Studentl82 ID82 36 17 97 70
Student83 Studentl83 ID83 43 78 38 60
Student84 Studentl84 ID84 18 62 50 75
Student85 Studentl85 ID85 93 6 99 86
Student86 Studentl86 ID86 77 8 17 21
Student87 Studentl87 ID87 1 88 93 98
Student88 Studentl88 ID88 50 26 23 52
Student89 Studentl89 ID89 54 3 1 95
Student90 Studentl90 ID90 30 73 90 24
Student91 Studentl91 ID91 87 22 18 98
Student92 Studentl92 ID92 58 1 42 86
Student93 Studentl93 ID93 9 32 36 96
Student94 Studentl94 ID94 53 36 49 15
Student95 Studentl95 ID95 50 47 13 90
Student96 Studentl96 ID96 8 57 79 64
Student97 Studentl97 ID97 7 29 97 85
Student98 Studentl98 ID98 9 10 49 54
Student99 Studentl99 ID99 56 82 58 39

*/

#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int main()
{
string name1,name2,id;
double weight[4];
double score[4];
double maxi=-1,mini=101,avg=0,total,sum=0,coun=0;
ifstream in;
in.open ("grades_w.txt");
in>>weight[0];
in>>weight[1];
in>>weight[2];
in>>weight[3];
while(in>>name1)
{
in>>name2;
in>>id;
in>>score[0];
in>>score[1];
in>>score[2];
in>>score[3];
total=0;
for(int i=0;i<4;i++)total+=score[i]*weight[i];
cout<<name1<<" "<<name2<<" "<<id<<" "<<"Total score:"<<total<<endl;
if(total>maxi)maxi=total;
if(total<mini)mini=total;
sum+=total;
coun++;
}
cout<<"The maximum score is:"<<maxi<<endl;
cout<<"The maximum score is:"<<mini<<endl;
cout<<"The average score is:"<<sum/coun<<endl;
return 0;
}