i just received some help from zandiago it his help was great and i thank you. when i incorporated the info into my program i received an error when building the solution. it was only one error. it was
error C2447: '{' : missing function header (old-style formal list?)
the error was at {
(in red) How do i fix that and could you please explain how you fix it. thank you. i really appreciate everyones help with my project. this is a great place to learn with the help of others. here is my program. any help or ideas is greatly appreciated
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main ()
;int playSomeGames();
{ //< here
int num;
int guess;
bool done;
int noOfGuesses=0;
int ncount;
int sum=0;
int noofgamesplayed = 0;
int avgNoOfGuesses;
noofgamesplayed++;
void playSomeGames( ) {
int numGamesPlayed = 0;
do {
playAGame();
numGamesPlayed++;
} while ( again );
cout << "You played " << numGamesPlayed << " games";
}
void playOneGame ( ) {
int numGuesses = 0;
do {
} while ( numGuesses < 10 );
cout << "You took " << numGuesses << " to guess";
}int main ( ) {
playSomeGames();
return 0;
}
void playSomeGames( ) {
int numGamesPlayed = 0;
do {
playAGame();
numGamesPlayed++;
} while ( again );
cout << "You played " << numGamesPlayed << " games";
}
void playOneGame ( ) {
int numGuesses = 0;
// generate a target value
do {
// prompt for guess etc
} while ( numGuesses < 10 );
cout << "You took " << numGuesses << " to guess";
}
sum += noOfGuesses;
avgNoOfGuesses=sum/noofgamesplayed;
srand((unsigned)time(0))
;num = (rand() % 1000);
done = false;
while ((noOfGuesses < 10) && (!done))
{
cout << "Enter an integer greater"
<< " than or equal to 0 and "
<< "less than 1000: ";
cin >> guess;
cout << endl;
noOfGuesses++;
if (guess == num)
{
cout << "you guessed the correct "
<< "number." << endl;
done = true;
}
else
if (guess < num)
cout << "Your guess is lower "
<< "than the number. \n"
<< "Guess again!" << endl;
else
cout << "Your guess is higher "
<< "than the number.\n"
<< "guess again!" << endl;
cout <<"Total gueses equal " << noOfGuesses << endl;
cout << "you played " << noofgamesplayed << " games";
}
return 0;
}