One Dimensional and Two Dimensional C problem helpSolutionHe

One Dimensional and Two Dimensional C++ problem help

Solution

Here is the code for the first 3 functions.

void readStudentIDs(int StdID[5])
{
for(int i = 0; i < 5; i++)
cin>>StdID[i];
}
void readStudentsFromFile(ifstream &fin, int StdID[], int Scores[][4])
{
for(int i = 0; i < 5; i++)
{
fin>>StdID[i];
for(int j = 0; j < 4; j++)
fin>>Scores[i][j];
}
}
void calculateAverageScores(int StdID[], int Scores[][4], float AvgOne[])
{
for(int i = 0; i < 5; i++)
{
AvgOne[i] = (Scores[i][0] + Scores[i][1] + Scores[i][2] + Scores[i][3])/4.0;
   AvgTwo[i] = (Scores[i][0] * 0.2 + Scores[i][1] * 0.3 + Scores[i][2] * 0.3 + Scores[i][3] * 0.2) / 4.0;
}
for(int i = 0; i < 5; i++)
cout<<StdID[i]<<\"\\t\"<<Scores[i][0]<<\"\\t\"<<Scores[i][1]<<\"\\t\"<<Scores[i][2]<<\"\\t\"<<Scores[i][3]<<\"\\t\"<<AvgOne[i]<<\"\\t\"<<AvgTwo[i]<<endl;   
}

One Dimensional and Two Dimensional C++ problem helpSolutionHere is the code for the first 3 functions. void readStudentIDs(int StdID[5]) { for(int i = 0; i <

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site