hi everyone, im having problems with my loop in my assignment im working on.
im not tryin to get the code from you guys. but would like some pointers on what im doing wrong.
im tryin to figure out why my "else" code wont work?
i've tried to look for anything that can help me out with it, but how i set it up, looks like all the others i've seen.
here is my code so far. can anyone tell me what im doing wrong with my "else" part?
#include <iostream>
using namespace std;
int main( )
{
srand(time(0));
int wheelNumber = rand() % 36 + 1;
cout<< "Welcome to roulette. You may bet on Even,Odd, or Zero" << endl;
cout<< "(use E, O, or Z.) Each bet is $5." << endl;
cout<< "If you bet zero and win, you win $50." << endl;
cout<< "You can choose Q to quit the game." << endl;
cout<< "The game ends automotically if you run out of money." << endl;
const int STARTING_MONEY = 100;
const int BET_AMOUNT = 5;
const int ZERO_WIN_AMOUNT = 50;
char typeOfBet = ' ';
cout<< endl;
double moneyRemaining = STARTING_MONEY;
double numberOfWins = 0;
double numberOfLosses = 0;
if (typeOfBet == 'E' || typeOfBet == 'e')
{
cout<< wheelNumber << endl;
}
else if (typeOfBet == 'O' || typeOfBet == 'o')
{
cout<< wheelNumber << endl;
}
else if (typeOfBet == 'Z' || typeOfBet == 'z')
{
cout<< wheelNumber << endl;
}
{
cout <<"Bet on E)ven,O)dd,Z)ero,or Q)uit > ";
cin >> typeOfBet;
}
{
cout<< wheelNumber <<endl;
}
if ((wheelNumber == 0) && (typeOfBet == 0));
((wheelNumber == 'O') && (typeOfBet == 'O'));
((wheelNumber == 'E') != ('0') && (typeOfBet == 'E'));
{
if (wheelNumber == 0);
{
(ZERO_WIN_AMOUNT + moneyRemaining);
}
else
{
if (wheelNumber == typeOfBet);
{
(BET_AMOUNT + moneyRemaining);
(numberOfWins += 1);
}
[
cout<<"You win! You now have $ " << STARTING_MONEY << endl;
]
}
}
}
}
system("PAUSE");
return 0;
}
after i compile it,it tells me this:
63 C:\Dev-Cpp\Class Work\cit020_08_10_27\mok_hai_roulette2.cpp expected primary-expression before "else"
63 C:\Dev-Cpp\Class Work\cit020_08_10_27\mok_hai_roulette2.cpp expected `;' before "else"
63 C:\Dev-Cpp\Class Work\cit020_08_10_27\mok_hai_roulette2.cpp At global scope:
76 C:\Dev-Cpp\Class Work\cit020_08_10_27\mok_hai_roulette2.cpp expected declaration before '}' token .
please help, i just want to know why line "63" is not working?