Question: Listed below is code to play a guessing game in which two players attempt to guess a number. Your task is to extend the program







Listed below is code to play a guessing game in which two players attempt to guess a number. Your task is to extend the program with objects that represent either a human player or a computer player. bool checkForwin (int guess, int answer if (answer guess cout You're right! You win! endl; return true; else if answer guess) cout Your guess is too high endl; else cout Your guess is too low endl; return false; void play (Player &player1 Player &player2 int answer 0, guess 0; answer rand 100 bool win false while (!win)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
