I am trying to get the numbers in the array to give me a average out put. here is what I have so for:
#include "stdafx.h"
#include <iostream>
#include <cctype>
using std::cout;
using std::cin;
using std::endl;
int main() {
int grade[10];
int count = 0;
char reply = 0;
int sum = 0;
do
{
cout<<endl;
cout<<"enter the grades in whole numbers: ";
cin>>grade[count++];
cout<<"Do you want to enter the next grade (y/n)? ";
cin>>reply;
}
while(count < 10 && std::tolower(reply) == 'y');
if(count == 10);
cout << "maximum number of grades reached." << endl;
double average = 0.0;
for(int i = 0; i < count ; i++);
average += grade[i];
average /= count;
cout<<endl;
cout<<"average grade is " <<average <<
cout<<endl;
return 0;
}
thanks for any help you can provide