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: 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!
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
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:
- 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 2 steps with 1 images