i have a machine problem to do. it should compute for the average grade of N scholars. N will be entered on the keyboard and the Student No. and Grades of the Scholars in *8 Subjects will be entered.
sample output of program should be like this.
STUDENT NO. S1 S2 S3 S4 S5 S6 S7 S8 AVERAGE
113 80 80 80 80 80 80 80 80 80
144 90 90 90 90 90 90 90 90 90
i dont know if what im doing is correct. this program should be solve using arrays in c++.
help me! i really need this. please :(
here is the sample of the code i have done. i dont know if this is correct since i cant execute it because an error (shown below) is present.
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <ctime>
using namespace std;
void Display(int ARR[], int SIZE, char C);
void Change(int ARR[], int SIZE);
int Increment(int x, int y);
int var_name[50];
int main()
{
int N;
cout<<"Enter Number of Scholars: ";
cin>>N;
cout<<"\n"<<N<<" Scholars would be evaluated.\n\n";
int j;
int scholars[N];
for(j=0;j<N;j++)
{ int SN;
cout<<"Enter Student Number for Scholar "<<j+1<<":";
cin>>SN;
int s;
float GS;
for(s=0;s<8;s++)
{ cout<<"Enter Grade of Scholar "<<SN<<" in Subject "<<s+1<<":";
cin>>GS;
}
cout<<"\n";
}
cout<<"SN\tS1\tS2\tS3\tS4\tS5\tS6\tS7\tS8\tAVE\n";
for(j=0;j<N;j++)
{
N=0;
scholars[N];
cout<<SN<<s+1<<s+2<<s+3<<s+4<<s+5<<s+6<<s+7<<s+8; //received an error in this area
N++;
}
int p;
cin>>p;
}