Answered You can hire a professional tutor to get the answer.

QUESTION

Build a program to design a version ofRock-Paper-Scissors where the user plays the computer. But I want your program to cheat-yes, cheat.

Build a program to design a version of Rock-Paper-Scissors where the user plays the computer. But I want your program to cheat - yes, cheat. Normally in a Rock-Paper- Scissors program the user would select Rock, Paper or Scissors and then the computer would select one randomly. But I want your program to let the user select one and the have the computer select the one that wins. So, if the user selects Rock, the computer should select Paper.

First ask the user how many games they want to play. This should be an odd number. If the user doesn't enter an odd number, give them an error and make them re-enter it. Then play Rock-Paper-Scissors that number of times.

At the end of the program should say who won a majority of the matches.

Example of input/output:

Welcome to Rock-Paper-Scissors

How many games of Rock-Paper-Scissors do you want to play? >> 2

Please enter an odd number of games. >> 4

Please enter an odd number of games. >> 3

Game 1 You can pick R - Rock P - Paper S - Scissors >> R

The computer picked Paper.

You lose.

Game 2 You can pick R - Rock P - Paper S - Scissors >> P

The computer picked Scissors.

You lose.

Game 3 You can pick R - Rock P - Paper S - Scissors >> S

The computer picked Rock.

You lose.

You won 0 games.

Computer won 3 games.

Computer wins!

Explain your solution and logic either with in-code comments or in a separate document

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question