Question: Write a program that lets the user play the Rock, Paper, Scissors game against the computer. The computer first chooses randomly between rock, paper and

Write a program that lets the user play the Rock, Paper, Scissors game against the computer. The computer first chooses randomly between rock, paper and scissors, but does not display its choice. It displays a menu of choices: rock, paper, scissors, or quit, and prompts the user to select a choice. If the users input does not match a choice on the menu, the program displays the menu again and prompts the user to reenter (You can assume the user always enters an integer). It then determines who is the winner, then displays the users and computers choice and a message to indicate the winner (user or computer or tie). The rules to determine the winner are: rock beats scissors, scissors beats paper and paper beats rock. The program loops to allow the user to play repeatedly multiple games, and at each iteration of the loop, the cumulative scores are displayed (i.e. how many times the user won and how many times the computer won). The user has the option to quit at the end of a game.

Below is the snapshots for further clarification

Write a program that lets the user play the Rock, Paper, Scissorsgame against the computer. The computer first chooses randomly between rock, paperand scissors, but does not display its choice. It displays a menu

of choices: rock, paper, scissors, or quit, and prompts the user to

Additional requirements-Make sure you meet all the requirements to avoid losing points 1. Follow the requirements in the "Homework Notes". 2. You should implement these functions getUserChoice: displays the menu, prompts the user to enter the choice, performs input validation, displays the menu again if the input is invalid (is not equal to any of the choices on the menu). Returns the user's choice (rock, paper, scissors or quit) if it is valic .getComputerChoice: uses the random number generator to randomly select a choice and returns the computer's choice determineWinner: takes as arguments the user's choice and the computer's choice and determines the winner. Prints the user's and computer's choices and who is the winner (computer or user or tie). This function also prints the user's and computer's cumulative score le how many times therw times thecompouter won Your main() function will have two parts: Driver part followed by Game part. The Driver part demonstrates the correctness of the determineWinner function, without random number generation. The Game part demonstrates the correctness of the menu display and reading user's input, random number generation and determineWinner function. Driver part for determineWinner Copy and paste the C++ code provided below // Game part Set the seed to 1000

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!