User Prompts Your program will allow a human user to play Rock, Paper, Scissors with the computer. At the beginning of the game, the user should be prompted for his/her input. The valid choices for...































User Prompts

Your program will allow a human user to play Rock, Paper, Scissors with the computer. At the beginning of the game, the user should be prompted for his/her input. The valid choices for input are:
• R or r (Rock)
• P or p (Paper)
• S or s (Scissors)
• Q or q (Quit)


Beginning of Round

At the beginning of each round your program should ask the user for an input.


Invalid Entry

If the user inputs something other than r, R, p, P, s, S, q or Q, the program should detect the invalid entry and ask the user to make another choice.


Round structure

Each round of the game will have the following structure:
1. The program will choose a weapon (Rock, Paper, Scissors), but its choice will not be displayed until later so the user doesn’t see it.
2. The program will announce the beginning of the round and ask the user for his/her weapon choice
3. The two weapons will be compared to determine the winner (or a tie) and the results will be displayed by the program
4. The next round will begin, and the game will continue until the user chooses to quit
5. The computer will keep score and print the score when the game ends


Weapon Selection

The computer should select the weapon most likely to beat the user, based on the user’s previous choice of weapons.


Random Weapon Selection

During rounds when the user does not have a single preferred weapon, the computer may select any weapon.


Quit

At the end of the game (when the user chooses ‘q’ or ‘Q’), your program should display the following:
1. The number of rounds the computer has won
2. The number of rounds the user has won
3. The number of rounds that ended in a tie
4. The number of times the user selected each weapon (Rock, Paper, Scissors)


Looping

Your program should continuously prompt for a command.

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here