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 < 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 <](/WebImages/14/one-dimensional-and-two-dimensional-c-problem-helpsolutionhe-1020996-1761528079-0.webp)