//CSC150 Lab11
//Ian Heinze
//11/3/2015
#include <iostream>
usingnamespace std;
constint NUM_SCORES = 5;
int main()
{
int i=0;
double test_scores[NUM_SCORES];
double sum=0;
double average;
while (i < NUM_SCORES)
{
cout << "Please enter the score: ";
cin >> test_scores[i];
sum = sum + test_scores[i];
i++;
}
average = sum / NUM_SCORES;
cout << "The average is " << average;
for (int i=0, i < NUM_SCORES, i++)
{
if (test_scores [i] > average)
{
cout << test_scores [i] << " is above average by " << test_scores [1] - average << endl;
}
elseif (test_scores [i] < average)
{
cout << test_scores [i] << " is below average by " << test_scores [1] - average << endl;
}
else
{
cout << test_scores [i] << " is equal to the average. " << endl;
}
}
return 0;
}
The code runs until it gets to the for loop, which is the only place I encounter any errors. What's wrong with it, and how would I begin to correct it?