So everything works right now, but I need that final section (will be turned into a function later) to display the number of A's, B's, C's, D's, and F's. It seems like it should be pretty simple, but nothing is working for me. Thanks!

``````#include <iostream>

using std::cout;
using std::cin;
using std::endl;

int main()
{
int scores,
average = 0,
double score = 0;

for ( int i = 0; i < 10; i++ )
{
cout << "Enter Student #" << i + 1 << "'s score: ";
cin >> scores[i];

score = scores[i];

if ( score >= 92.0 )
cout << "You scored a " << scores[i] << ". You received an A" <<'\n';
else
if ( score >= 84.0 && score < 92.0 )
cout << "You scored a " << scores[i] << ". You received a B" <<'\n';
else
if ( score >= 75.0 && score < 84.0 )
cout << "You scored a " << scores[i] << ". You received a C" <<'\n';
else
if ( score >= 65.0 && score < 75.0 )
cout << "You scored a " << scores[i] << ". You received a D" <<'\n';
else
if ( score < 65.0 )
cout << "You scored a " << scores[i] << ". You received an F" << '\n';
}

average = ( scores + scores + scores + scores + scores + scores + scores + scores + scores + scores ) / 10;

cout << "Average class score: " << average <<'\n';

cout << "Number of A's: " <<'\n'
<< "Number of B's: " <<'\n'
<< "Number of C's: " <<'\n'
<< "Number of D's: " <<'\n'
<< "Number of F's: " <<'\n';

return 0;
}
``````

Keep a set of counter variables to count the number of A's, B's, C's etc.
Initialise them to zero at the beginning of your program, increment the appropriate counter when a grade is assigned in your block of if..else if statements.

e.g.
Declare some counters with the rest of your variables:

``````int numAs, numBs, numCs, numDs, numFs;
numAs = numBs = numCs = numDs = numFs = 0;
``````

Increment the appropriate counter in your if..else if block:

``````if ( score >= 92.0 )
{
cout << "You scored a " << scores[i] << ". You received an A" <<'\n';
++numAs;
}
else if ... // I'll leave you to do the rest!
``````

`cout << "Number of A's: " << numAs << '\n'`