(Solved):12. Coin Toss Simulator Write a class named Coin. The Coin class should have the following member variable: A string named sideUp. The sideUp member variable will hold either “heads” or “tails” ind… View Answer…

 

Question

12. Coin Toss Simulator

Write a class named Coin. The Coin class should have the following member variable:

A string named sideUp. The sideUp member variable will hold either “heads” or “tails” indicating the side of the coin that is facing up. The Coin class should have the following member functions:

A default constructor that randomly determines the side of the coin that is facing up (“heads” or “tails”) and initializes the sideUp

Scroll to top