help a newbie out =)

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

// compiler directives
#include <iostream>
#include<iomanip>
#include<stdio.h>

using namespace std;

// constant identifiers
const int MAXSIZE = 10;

// function prototypes
void GetData(int TestScoresf[]);
void ComputeAvg(int TestScoresf[],float &Avgf);
void PrintReport(int TestScoresf[],float Avgf);
void PrintSorted(int TestScoresf[],float Avgf);

// 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

void PrintReport (int TestScoresf[], float Avgf)
{
{

//Local variable declarations.
int first_unsort = 0;
int other_unsort = 0;
int pos_min = 0;
int min = 0;
int temp = 0;
int index = 0;




//Starts the sorting process, explained above.
for (first_unsort = 0; first_unsort < 10; first_unsort++)
{
min = TestScoresf[first_unsort];
pos_min = first_unsort;

for (other_unsort = first_unsort +1; other_unsort < 10;
other_unsort++)
{
if (TestScoresf[other_unsort] < min)
{
min = TestScoresf[other_unsort];
pos_min = other_unsort;
}
}

//Values are exchanged.
temp = TestScoresf[first_unsort];
TestScoresf[first_unsort] = min;
TestScoresf[pos_min] = temp;
}

cout<<setw(23)<<"Test#"<<setw(15)<<"Test…
cout<<"\n\n";
for(int i = 0; i <MAXSIZE; i ++)
{
cout<<setw(26)<<i+1<<setw(20)<<TestScore…
}
cout<<"\n\n"<<fixed<<showpoint<<setpreci…
cout<<"test score average:\t"<<Avgf<<endl;

for (int i = 0; i < MAXSIZE; i++)
{
for (int j = i + 1; j < MAXSIZE; j++)
{
if (TestScoresf[j] < TestScoresf[i])
{
temp = TestScoresf[i];
TestScoresf[i] = TestScoresf[j];
TestScoresf[j] = temp;
}
}

// end print Report
void printsorted (int TestScoresf[], float Avg);
{


}
}
}
}





p.s I am really new so if you could dumb it down to a newbie answer that I could understand that would be awesome =D
Post your code correctly so its easy to read and people will be more willing to help you out.
By correctly he means using code wrap [.code][./code] without the dots, and indent it properly.
Your code makes no sense. There are random brackets everywhere.
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.
Topic archived. No new replies allowed.