Question: Write a complete java program that plays a single game of craps, displays the individual rolls and reports when a game is LOST or WON
Write a complete java program that plays a single game of craps, displays the individual rolls and reports when a game is LOST or WON and shows the number of rolls used by the game.
The algorithm is as follows:
Simulate the roll of 2 dice using a JAVA random number generator.
Record the sum of this first roll as the game point and print out: Game point:
(if) the game point is 7 or 11 print out: Game won in 1 roll
(else) continue rolling the dice. After each roll, print:
(if) a roll is either 7 or 11 print out: Game lost in
(else if) a roll equal the game point print out: Game won in
Otherwise, repeat step 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
