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[10],
average = 0,
grade [10];
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[0] + scores[1] + scores[2] + scores[3] + scores[4] + scores[5] + scores[6] + scores[7] + scores[8] + scores[9] ) / 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;
}