Question: Create an abstract Player class that consists of private data for name, selection, wins, and losses. It must have a non-default constructor that requires
Create an abstract Player class that consists of private data for name, selection, wins, and losses. It must have a non-default constructor that requires name. It may not contain a default constructor. Create overloaded functions for the ++ and -- operator. The overloaded ++operator will add to the number of wins, while the -- operator will add to the losses. You will create two different child classes of player, Human and Computer. Neither of which will have any private data, as they will use the parent's data. Both will contain a virtual function called makeSelection() that will determine and set the selection for the particular player. Your main() program will contain a NON-member function called playGame() that will take in your two players. You should ask the user if they would like to pay against another human, or a computer, or if they would like to see two computers play. You will then need to create the appropriate objects and start the game play. After each round, you must display the number of wins and losses for each player and continue playing the game until the user decides to quit.
Step by Step Solution
3.47 Rating (150 Votes )
There are 3 Steps involved in it
Heres a C implementation of the described program including the Player Human and Computer classes wi... View full answer
Get step-by-step solutions from verified subject matter experts
