Question: (Intro to Java help?) Write a complete program that plays a coin flipping game, displays the individual flips, reports when a game is LOST or
(Intro to Java help?)
Write a complete program that plays a coin flipping game, displays the individual flips, reports when a game is LOST or WON and shows the number of flips needed to complete the game.
The algorithm is as follows:
Simulate the flip of a coin using a JAVA random number generator.
Flip the coin once to initialize the flip value and print out the flip
Inside of a loop, repeatedly flip the coin until 3 consecutive flips have the same value (3 heads or 3 tails)
Display the flip results after each flip
When the game ends, report the total number of flips
Note: you can use 0 for heads and 1 for tails, but if you have time, add another method that will convert the integers 0 and 1 to the characters H and T
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
