Hi, the problem with my code is that, the for loop gets the average but then it adds that average to another average and so forth. So, the first student gets the correct average but then the following student gets an average but his/her average gets added with the previous average.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
for (int x=0;x<5;x++)//this is where i'm having probelms
{
totalaverage=totalaverage+TestScores[x];
}
total=totalaverage/5;
cout<<total<<endl;
}
return 0;
system ("pause");
}