Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Programming Language is C++ Create a version of the Rock, Paper, and Scissors game using functions. The game must: Display a clear set of instructions
Programming Language is C++
Create a version of the Rock, Paper, and Scissors game using functions. The game must: Display a clear set of instructions to the user Input R, P, or from the user. Validate the input, if incorrect prompt the user to re-enter until correct. Either upper or lower case is ok. 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 he/she would like to play again and repeat the entire game again as necessary. You need to have at least the following functions: displayinstructions o no inputs, tells the user how to play the game getMove o no inputs, get a move from the user and validate, return lower case char ('r','p','s') getCompMove o no inputs, get a random number between 1 and 3, convert to a valid move ('r','p','s'), return the move getWinner o inputs are two chars (user's move and computer's move), report who won or if tie playAgain o no inputs, return true if the user wants to go again, false if they do not Your program should have appropriate comments (including at least one per function) and you should use constants where appropriate. All input should be validatedStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
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