I know I am been asking this question. But I am so close and I don't understand what to do. I can get everything to work just fine but one thing. It prints out the scores fine in order but then the test number doesnt print out right. for example I have test 1 i got 65 and test 2 got a 45 it will say test one got the 45 and test to got the 65 when it prints out and im unsure how to fix it. here is my code
// main program
int main()
{
// local identifiers
int TestScores[MAXSIZE],temp[MAXSIZE];
float Avg, unnsorted_list;
//Input modale
GetData(TestScores);
//processing module
ComputeAvg(TestScores,Avg);
//output module
PrintReport(TestScores,Avg);
system ("PAUSE");
return 0 ;
}//end main
// function definitions
void GetData (int TestScores[ ])
{
for (int i=0; i <MAXSIZE; i++)
{
cout<<"please enter the test score #"<<i+1<<":\t";
cin>>TestScores[i];
}
return;
}
// end GetData
void ComputeAvg( int TestScoresf[],float&Avgf)
{
float sum = 0;
for(int i=0; i <MAXSIZE; i++)
{
sum = sum+ TestScoresf[i];
}
Avgf = float(sum)/MAXSIZE;
return;
} //end ComputeAvg
I think whatever method you use to sort it wont keep track of the right test numbers , unless you save each grade with respect to its test number you wont succeed.
Try to check the code i pasted on your last thread.