I'm getting this
fatal error C1004: unexpected end-of-file found
error and I've checked all of my brackets. What else could be the problem?
Name:
Anonymous2009-09-29 22:04
#include <cstdlib>
#include <iostream>
#include <string>
// random stats should be 8-25
using namespace std;
int hall = 0;
string name;
int time;
int money;
int intelligence;
int Highscore[10];
class main
{
void menu()
{
int selection = 0;
cout << "Enter the number for your selection:\n "
<< "1.Start Game\n"
<< "2.High Scores\n"
<< "3.Exit";
cin >> selection;
if(selection == 1)
{
cout << "Please enter the character's name\n ";
cin >> name;
cout << "Welcome to your doom," + name;
character();
menu2();
}
else if(selection == 2)
{
for (int i = 0; int size = 10; i < size; i++)
{
cout << Highscore[i] << "\n";
}
}
else if(selection == 3)
{
exit(0);
}
else
{
cout << "Please enter a valid selection.";
cin >> selection;
}
}
void character()
{
int money = (rand()%17)+8;
int time = (rand()%17)+8;
int intelligence = (rand()%17)+8;
int hall = 0;
bool win = false;
}
void ScoreBoard()
{
int max;
for (int i = 1; i <= 10; i++)
{
if (Highscore[i] > max)
{
max = Highscore[i];
}
}
}
void menu3()
{ cout <<"\a You have died\n"
<< " Your score only records if you win. Sorry.\n"
menu();
}
void menu4()
{
Highscore[1] = time + money + intelligence;
cout << "\a You have won!\n"
<< "Time = " + time + "+\n"
<< "Money = " + money + "+\n"
<< "Intelligence = " + intelligence + "+\n"
<< " Equals your score of..." + Highscore[1] + "\n"
<< "Check to see if your score made it in the top 10 list!\n";
menu();
}
void Encounters()
{
int chance = (rand()%20 + 1);
int randtime = (rand()%10);
int randmoney =(rand()%10);
int randint = (rand()%10);
if(chance <= 1 )
{
//10%
cout << " You have to grade papers.\n"
<< " You lose " +randtime + " time\n"
<< " but gain " + randmoney + " money.";
hall++;
time = time - randtime;
money = money + randmoney;
menu2();
}
else if (1 < chance <= 6 )
{
//25%
cout << "Nothing happens." << "You lose 1 time.";
hall++;
time--;
menu2();
}
else if(6 < chance <= 11)
{
//25%
cout << "You encounter a puzzle.";
puzzle();
}
else if(11 < chance <=13 )
{
//10%
cout << " You encounter a professor!"
<< " You lose " + randtime + "time....\n"
<< " but gain " + randint + "intelligence!";
hall++;
time = time - randtime;
intelligence = intelligence +randint;
menu2();
}
else if(13 < chance <=16)
{
cout << " You are attacked by grunt work!"
<< " You lose " + randtime + " time and\n"
<< + randint + " intelligence.";
hall++;
time = time - randtime;
intelligence = intelligence - randint;
menu2();
//15%
}
else if( 16 < chance <=18)
{
//10%
cout << " You encounter a graduate student.\n"
<< " You lose " + randtime + " time.";
hall++;
time = time - randtime;
menu2();
}
else if ( chance >= 19)
{
cout << "You found a nickel! Too bad it was glued to the floor..\n"
<< " Lose 1 time trying to pry the nickel off the floor.";
time--;
hall++;
menu2();
}
}
void puzzle()
{
int answer;
int q =(rand()%5);
if( q <= 1)
{
cout << "How much time do you have left?";
cin >> answer;
if ( answer != time)
{
cout << "Apparently NONE!";
menu3();
}
else
{ cout << "You gain 1 time!";
time++;
hall++;
menu2();
}
}
if( q == 2)
{
cout << "What level COMP class is this?";
cin >> answer;
if ( answer != 2710 )
{
cout << "You must never come to class...";
menu3();
}
else
{ cout << "You gain 1 time!";
time++;
hall++;
menu2();
}
if( q == 3)
{
cout << "What is 5 % 4?"
cin >> answer;
if (answer != 1)
{menu3();
else
{
cout << "You gain 1 time!";
time++;
hall++;
menu2();
}
if (q == 4)
{
cout << "What is 4444 - 3107 ?"
cin >> answer;
if (answer != 1337)
{
menu3();
}
else
{
cout <<" You gain leet time! (actually just 1, sorry.)";
time++;
hall++;
menu2();