#include "iostream.h"
void
prt_scores(double *s, int count)
{
double tot;
int c;
if (count == 0)
{
cout << "There were no scores submitted.\n";
}
else
{
cout << "The submitted scores were:" << endl;
for (c = 0; c < count; ++c)
{
tot += s[c];
cout << s[c] << endl;
}
double avg = tot / count;
cout << "The average score was " << avg << endl;
cout << "The following scores were below average\n";
for (c = 0; c < count; ++c)
{
if (s[c] < avg)
cout << s[c] << endl;
}
}
}
int main(char *argv, int argc)
{
int count = 0;
double s[10];
cout << "Enter upto 10 scores\n";
cout << "Enter a non-numerical value to finish\n";
while (count < 10)
{
double val = 1010.0101;
cout << count + 1 << ". Enter Test Score: \n";
cin >> val;
if (val == 1010.0101)
{
break;
}
s[count++] = val;
}
prt_scores(s, count);
return 0;
}