Question: In java please, Write e a program called CoinFlip that simulates flipping a coin repeatedly until three consecutive heads are tossed. The program should then

In java please,

In java please, Write e a program called CoinFlip that simulates flipping

Write e a program called CoinFlip that simulates flipping a coin repeatedly until three consecutive heads are tossed. The program should then display the total number of times the coin was flipped. The user does not have to enter any information. This problem is an example of using a while loop to repeat something an unknown number of times. You'll need to use the Random class to simulate coin flips. Example: Tails Heads Tails Tails Heads Tails Heads Heads Heads It took 9 flips to get 3 consecutive heads

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!