Question: Program Description: The objective of this program is to flip three coins until they all land on the same side. You are collectively flipping three

Program Description:

The objective of this program is to flip three coins until they all land on the same side. You are collectively flipping three coins. Flipping both coins simultaneously will continue until they both land on the same side. Each time, you should print a statement, ending it with the total number of flips. Coin class must have a constructor, setters, getters, private instance variables, and a flip function. The coin objects will be created by your CoinTester class, which will also call the flip method, inquire about the number of flips, and print the results.

Statements Required: class, methods,

Sample output: coin 1 is on heads, coin 2 is on tails, coin 3 is on tails coin 1 is on tail, coin 2 is on heads, coin 3 is on tails coin 1 is on heads, coin 2 is on tails, coin 3 is on tails coin 1 is on tails, coin 2 is on tails, coin 3 is on tails The coins were flipped a total of 4 times.

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!