This is an example on the code is suppose to output things:
• Player bets $10 on Crown and rolls one Crown: gets $10 bet back plus wins an additional
$10.
• Player bets $10 on Diamond and rolls two Diamonds: gets $10 bet back, plus wins an
additional $20.
• Player bets $10 on Anchor and rolls three Anchors: gets $10 bet back, plus wins an
additional $30.
• Player bets $10 on Spade and rolls no Spades: loses the $10 bet.
-----------------------------------------------------------------------------
my code:
if (symbol == dice1 || symbol == dice2 || symbol == dice3){
moneyWon = moneyWon + bet + (bet *3);
balance = balance + moneyWon;
cout << "You won: $" << moneyWon << endl;
cout << "Your balance is: $" << balance << endl;
}
else if (symbol == dice1 || symbol == dice2 || symbol != dice3){
moneyWon = moneyWon + bet + (bet *2);
balance = balance + moneyWon;
cout << "You won: $" << moneyWon << endl;
cout << "Your balance is: $" << balance << endl;
}
else if (symbol == dice1 || symbol != dice2 || symbol != dice3){
moneyWon = moneyWon + bet + (bet *1);
balance = balance + moneyWon;
cout << "You won: $" << moneyWon << endl;
cout << "Your balance is: $" << balance << endl;
}
else if ( symbol != dice1 && symbol == dice2 && symbol != dice3){
moneyWon = bet;
balance = balance - moneyWon;
cout << "You lost: $" << moneyWon << endl;
cout << "Your current balance is: $" << balance << endl;
}
-------------------------------------------------------------------------------
Im having trouble coding this part of the program and would like some feedback on what I can do.
If you do that, we can have line numbers, keyword highlighting, and we can run the code right here with the gear icon. All these things make life much easier.