Howdy! So I'm taking this online intro to C class and have not been able to get in touch with my instructor because I think he's on vacation.Grrrrr. Anyway, If someone could give me some hints on what is wrong with this code I would really appreciate it. I am NOT looking for answers,just hints. Thanks in advance!
# include <iostream>
using namespace std;
//
int main ()
{
//declare array
int scores[20] = {90, 54, 23, 75, 67, 89, 99, 100, 34, 99, 97, 76, 73, 72, 56, 73, 72, 20, 86, 99};
//Declare variables
int searchScore = 0;//Statement 1
int total = 0;
//
cout << "Studentscore11 Program Output. \n\n";
//
cout << "Enter a score from 0 through 100 (-1 to end): ";
cin >> searchScore;//Statement 2
//
while (searchScore >= 0);//Statement 3
{
total = 0;
//search for score
for (int x = 0; x < 20; x += 1)//Statement 4
{
if (scores[20] == searchScore);//Statement 5
{
total = total + 1;
}//End if
}//End for
//Display total
cout << "Number of students earning a score of " << searchScore << ": " << total << endl << endl;
cout << "Enter a score from 0 through 100 ( -1 to end): ";
cin >> searchScore;//Statement 6
}//End while
cout << "\n\n";
system("pause");
return 0;
}//End of main function