Question: Programming Language is C++ Problem description For this exercise you will create a version of the Rock, Paper, and Scissors game that is played against
Programming Language is C++
Problem description
For this exercise you will create a version of the Rock, Paper, and Scissors game that is played against the computer. The program will use a number of functions as listed below. The computers move will be randomly generated. While this program will be an introduction to using functions, it will also be a review of data validation and loops. In addition to using functions, you will be using enums.
Program Functionality
The game must use enums to represent both the user and computer moves. Constants should be used where appropriate.
Display a clear set of instructions to the user
Input R, P, or S from the user. Validate the input, if incorrect prompt the user to re- enter until correct. Either upper or lower case is ok.
Get a random computer move.
Display clear output describing the outcome of the game including the user's pick, the computer's pick and the winner.
Ask the user if they would like to play again and repeat the entire game again as necessary.
Required Functions
At a minimum the program should have the following functions:
showInstructions
o no parameters
o tells the user how to play the game o no return values
getUserMove
o no parameters
o get a move from the user and validate (R, r, P, p, S, or s) o return appropriate enum (Rock, Paper, Scissors)
getCompMove
o no parameters
o generate a random value 0, 1, or 2 o return appropriate enum (Rock, Paper, Scissors)
getWinner o two parameters (user move and computer move as enums)
o determine winner as described below o output the results o no return values
playAgain o no parameters
o ask the user if they want to play again o valid the result (y/n)
o return true for y, false for n
Thank you.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
