Define a class that represents a coin. The coin has two sides, heads and tails. Only one side of the coin is up, or visible, at any time. A program that uses your class should be able to specify which...


Define a class that represents a coin. The coin has two sides, heads and tails. Only one side of the coin is up, or visible, at any time. A program that uses your class should be able to specify which side is up, detect which side is up, turn the coin over—that is, if it is heads, make it tails and vice versa—and toss the coin so that its visible face is a random event.


After you design and implement the class, write a main method that demonstrates all the methods in the class.



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here