Write a program that a C++ program that can be used to determine grades at the e
ID: 3538523 • Letter: W
Question
Write a program that a C++ program that can be used to determine grades at the end of the semester.
For each student, who is identified by an integer number between 1 and 60, four examination grades
must be kept. Additionally, two final grade averages must be computed. The first grade average is
simply the average of all four grades. The second grade average is computed by weighting the four
grades as follows: the first grade gets a weight of 0.2, the second grade gets a weight of 0.3, the third grade a weight of 0.3, and the fourth grade a weight of 0.2; that is computed as:
Explanation / Answer
#include<iostream.h>
int i,j;
void stud(float a[ ] [ ])
{
for(i=0;i<60;i++)
{
a[i][5] = ( a[i][2] + a[i][3] + a[i][4] + a[i][5] ) / 4;
a[i][6] = (0.2*a[i][2] + 0.3*a[i][3] + 0.3*a[i][4] + 0.2*a[i][5] ) / 4;
}
cout<<"Sr. No. Mark1 Mark2 Mark3 Mark4 Grade1 Grade2");
for(i=0;i<60;i++){
for(j=0;j<7;j++){
cout<<a[i][j]<<" ";}
cout<<" ";
}
float mean1,mean2;
for(i=0;i<60;i++){
mean1+=a[i][5];
mean2+=a[i][6];
}
cout<<"Mean Grade1= "<<mean1;
cout<<"Mean Grade2= "<<mean2;
}
void main()
{
float arr[60][7];
void stud(float[]);
cout<<"Enter student number and marks in 4 subjects";
for(i=0;i<60;i++)
for(j=0;j<5;j++)
{
cin>>arr[i][j];
}
stud(arr[ ] [ ]);
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.