Answered step by step
Verified Expert Solution
Link Copied!

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++

image text in transcribed

image text in transcribed

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 validated

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions