i have been fooiling around with my program for class trying to get it to work, but now i get this error message:
error C2064: term does not evaluate to a function taking 1 arguments
it is referring to this part of the program:
num = (rand() + time(0)) % 1000;
could anyone explain what i did wrong and how i can fix it. thank you
here is the program. i have been having problems doing this correctly so i hope this works
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main ()
{
int num;
int guess;
bool done;
int noOfGuesses=0;
int ncount;
int sum=0;
int noofgamesplayed;
int avgNoOfGuesses;
int time;
sum += noOfGuesses;
avgNoOfGuesses=sum/noofgamesplayed;
num = (rand() + time(0)) % 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;
}
return 0;
}