i keep getting this error (error C2447: '{' : missing function header (old-style formal list?)
can someone give me a hint or help me out, I went from 23 errors to 1.
// Enter a grade which is 1 and 100 for user.
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
using std::cerr;
#include <cstdlib>
using std::rand;
#include <ctime>
void grade();
bool isCorrect( int, int ); // function
int main();
{
// srand( time( 0 ) ); // seed random number generator
grade(void);
return 0; // termination
} // end main
// grade generates numbers between 1 and 100
// and checks grade
void grade()
{
int answer; // randomly generated number
int guess; // grade entered
char response; // 'y' or 'n'
do{
// generate random number between 1 and 100
// 1 is shift, 100 is scaling factor
answer = 1 + rand() % 100;
// prompt for grade
cout << "Enter number between 1 and 100.\n"
<< "Enter Grade?\n" << endl << "? ";
cin >> guess;
// loop until correct number
while ( !isCorrect( guess, answer ) )
cin >> guess;
// prompt for another grade
cout << "\nExcellent! The grade is !\n"
<< "Would you like to enter a grade again (y or n)? ";
cin >> response;
cout << endl;
} while ( response == 'y' );
}// end function grade
// isCorrect returns true if g equals a
// if g does not equal a, displays hint
bool isCorrect( int g, int a )
{
// grade is correct
if ( g == a )
return true;
// grade is incorrect; display hint
if ( g < a )
cout << "Grade is to low. Try again.\n? ";
else
cout << "Grade is to high. Try again.\n? ";
return false;
} // end function isCorrect