#include <iostream>
using namespace std;
int main()
{
int TESTS = 0;
int testScore[TESTS];
int testNum = 0;
int a;
double total = 0;
double average;
testNum = 0;
cout<<"How many scores are there? ";
cin >> TESTS;
cout<<"Enter a score: ";
cin >> testScore[testNum];
while(testNum < TESTS && testScore[testNum])
{
total += testScore[testNum];
++testNum;
if(testNum < TESTS)
{
cout<<"Enter a score: ";
cin>>testScore[testNum];
}
}
cout<< "The entered test scores are: ";
for (a = 0; a < testNum; ++a)
cout<<testScore[a]<<" ";
average = total / testNum;
cout<<endl<<"The average test score is "<<average<<endl;
system("PAUSE");
}
I am trying to find the highest, lowest and average in this array. I can get the average, but I am not sure how to get it to pull the highest and lowest values that are entered.