(Solved):Write the following in C++ Coin Toss Simulator Write a class named Coin . The Coin class should have the following member variable: ? A string named sideUp . The sideUp View Answer…

 

Question

Write the following in C++

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
Scroll to top