Using Java create a craps game prompting users to play bets, tracking win / lose records. keeping track of bet winnings and losses. if user doesn't have enough money to continue bets end game. The craps game has to follow these conditions, also prompt user to initiate each roll. after each game user can choose to continue or quit game. when game ends user receive win / loss stats and money earn or lost stats. When the program is run, it will prompt the player for the starting balance of their account (in dollars). At the start of each game, the player will be asked for their bet. The bet must be at least $1, but cannot exceed the balance of their account. During the game, the outcome of each roll must be output to the display. When the outcome of the game is decided, the account balance must be updated accordingly based on the player’s bet. If the player wins, the amount of the bet is added to the account balance; if the player loses, the account balance is decreased by the bet amount. At the conclusion of the session, the program will output the following information before terminating: Number of games played Percentage of games won and lost Current account balance Percentage increase or decrease in account balance since the session began sample output Example Game Output (yours may vary): Do you wish to play another game? y Please input your bet for the game >> $100 Invalid bet – Your balance is only: $50 Please input your bet for the game >> $25 Sadly, you are no longer eligible to play Your ending account balance is: $ 0.00 Your starting balance has decreased by $200.00 (-100%) Of the 10 games played, you have won 3 games (30.0 %) and lost 7 games (70.0 %) Buh, bye – Get more $$ and play again soon!
Using Java create a craps game prompting users to play bets, tracking win / lose records. keeping track of bet winnings and losses. if user doesn't have enough money to continue bets end game. The craps game has to follow these conditions, also prompt user to initiate each roll. after each game user can choose to continue or quit game. when game ends user receive win / loss stats and money earn or lost stats.
- When the program is run, it will prompt the player for the starting balance of their account (in dollars).
- At the start of each game, the player will be asked for their bet. The bet must be at least $1, but cannot exceed the balance of their account.
- During the game, the outcome of each roll must be output to the display.
- When the outcome of the game is decided, the account balance must be updated accordingly based on the player’s bet. If the player wins, the amount of the bet is added to the account balance; if the player loses, the account balance is decreased by the bet amount.
- At the conclusion of the session, the program will output the following information before terminating:
- Number of games played
- Percentage of games won and lost
- Current account balance
- Percentage increase or decrease in account balance since the session began
sample output
Example Game Output (yours may vary):
Do you wish to play another game? y
Please input your bet for the game >> $100
Invalid bet – Your balance is only: $50
Please input your bet for the game >> $25
Sadly, you are no longer eligible to play
Your ending account balance is: $ 0.00
Your starting balance has decreased by $200.00 (-100%)
Of the 10 games played, you have won 3 games (30.0 %) and lost 7 games (70.0 %)
Buh, bye – Get more $$ and play again soon!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images