Coin.h and Coin.cpp Write a class named Coin. The Coin class should have the following members variable: A string named sideUp. The sideUp member variable
Coin.h and Coin.cpp Write a class named Coin. The Coin class should have the following members 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:
Your class specification must be saved in Coin.h and the function definitions need to be saved in Coin.cpp. 1. Coin Toss Simulator: repl.it C++ program : Write a program that demonstrates the Coin class. The program should create an instance of the class and display the side that is initially facing up. Then, use a loop to toss the coin 20 times. Each time the coin is tossed, display the side that is facing up. The program should keep count of the number of times heads is facing up and the number of times tails is facing up, and display those values after the loop finishes. | ||||||||||||
1. |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started