Write a C++ program to compute the final grade for a course. Student name, ident
ID: 3618166 • Letter: W
Question
Write a C++ program to compute the final grade for a course. Student name, identifies students. The final grade is composed of two parts, homework average counts for 40 and test average counts for 60 percent. There are two tests; each has maximum points of 100. There are 7 homework assignments, with maximum points of 25, 30, 40, 50, 35, 35 and 50 respectively. Homework average is computed by adding all the homework scores together then divide by maximum possible points. The final grade needs to be converted to letter grade, and the scale is listed below:
90-100 A
80 – 89 B
70 – 79 C
60 – 69 D
59 < E
After each student's grade is determined, the program performs a statistics on the entire class by finding out how many A's, B's, C's, D's and F's in the class.
The program should read input from data file "prg7data.txt", which is included in the assignment folder. The output should go to file "prg7out.txt", which is to be created, and should have information for each student followed by class statistics. The average and final scores should always be printed with no decimal place.
info from "prg7data.txt"
Sena Othmancio 77 88 22 28 35 45 33 35 40
Laura In 97 90 25 30 38 48 34 35 50
Habood Nowah 79 82 25 30 32 47 30 33 46
Ibraham Anned 90 86 25 30 40 46 34 35 50
Sabreena Bat 77 82 25 30 36 46 33 32 47
Maggy Magou 67 72 23 28 35 44 30 30 44
Tami Timm 76 83 25 29 38 49 35 35 49
Gil Bill 86 79 45 35 38 45 50 45 48
The following is a sample data file, in the order of student name, two test scores, and seven homework scores on each line:
Laura In 97 90 25 30 38 48 34 35 50
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
Explanation / Answer
please rate - thanks in=getInput ( stu,12 ); function getInput takes as parameters the array stu, which has atmost 12 students, and returns how many students there actually areinto variable in #include #include #include using namespace std; struct SStudent{ string name; double hwAve; double testAve; double finalScore; char grade; double tests[2]; double homework[7]; double part; } stu[12]; int getInput ( SStudent [], int); void process ( SStudent [], int ); void display ( const SStudent [], int ); int main() {int n; n=getInput ( stu,12 ); if(n>last; stu[m].name=first+" "+last; for(i=0;i>stu[m].tests[i]; for(i=0;i>stu[m].homework[i]; stu[m].part=100; m++; in>>first; } 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]={'F','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.