Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++: This is a program that needs to play rocks papers scissors and loops until you decide to use the quit option. Thank you so

C++: This is a program that needs to play rocks papers scissors and loops until you decide to use the quit option. Thank you so much!

image text in transcribedimage text in transcribed 1) Write a function getUserChoice that displays the menu and validate the choice: Game Menu 1) Rock 2) Paper 3) Scissors 4) Quit Enter your choice (1-4): //If the user enters 4, the program should end. 2) Write a function getComputerchoice, When the program begins, a random number in the range of 1 through 3 is generated. The user enters his or her choice of "rock", "paper", or "scissors" at the keyboard. 3) Write a function displayChoice to display the user's choice and computer's choice 4) Write a function determineWinner to displays a message indicating the winner. This should be made based around the actual rules of Rocks, Papers, Scissors. Have the game be repeated after each round, whether there is a winner, loser or a tie.| Input Validation: Display an error message if the user enters a number outside the range of 1 through 4 when selecting an item from the menu. e Output: Assignment \#3 by John Smith Game Menu 1) Rock 2) Paper 3) Scissors 4) Quit Enter your choice: 2 You selected: Paper The computer selected: Paper Tie. No winner. Game Menu 1) Rock 2) Paper 3) Scissors 4) Quit Enter your choice: 3 You selected: Scissors The computer selected: Paper YOU win! Paper wraps scissors. Game Menu 1) Rock 2) Paper 3) Scissors 4) Quit Enter your choice: 2 You selected: Paper The computer selected: Scissors Computer wins! Paper wraps scissors. Game Menu 1) Rock 2) Paper 3) Scissors 4) Quit Enter your choice: 4 Press any key to continue

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

Step: 3

blur-text-image

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

Databases DeMYSTiFieD

Authors: Andy Oppel

2nd Edition

0071747990, 978-0071747998

More Books

Students also viewed these Databases questions

Question

Define language, and recognize its properties.

Answered: 1 week ago