cout'ing the highest and lowest data values in a set

#include<iostream>
#include <string>
#include<fstream>
#include <iomanip>
using namespace std ;

int main()
{

string name ;
int sum, //sum of scores for one student
count, // number of tests for one student
score, // student score
average, // average for one student
x; // Number of times the loop was run

ifstream inData; //input file stream variable

inData.open("Self_paced.txt");
if ( !inData)
{
cout << " input file not found \n";
system ("pause");
return 1;
}
x=0;

inData >> name;
while (inData )
{
// one student


cout <<"Name: " << name << endl;
sum = 0;
count =0;
x++;
inData >> score;
cout <<"Scores:" ;
while (score != -99)
{ cout << score << " ";
sum = sum + score;
count++;
inData >> score ;

}
average = static_cast<int> ((sum /count)+.5);
cout << "\nYour average after " << count << " scores is " << average << ".";
if (average >= 90)
cout << " Wonderful!" << endl;
else if (average < 60)
cout << " Terrible!" << endl;
else
cout << " Okey dokey!" << endl;
cout <<"**********************\n";

inData >> name;
}

cout << "\n\nProcessing is complete\n";
cout << x << " students were processed." << endl;
system ("pause");
return 0;
}


I need to edit this code to make it cout the highest and lowest test scores. Any ideas?
Topic archived. No new replies allowed.