Question: To program a regular RPS game, you can follow these steps: 1 . User s choice: Prompt the user to choose rock, paper, or scissors.

To program a regular RPS game, you can follow these steps:
1. Users choice: Prompt the user to choose rock, paper, or scissors. You can
assume 1 for rock, 2 for paper, and 3 for scissors.
2. Take user input.
3. Computers choice: Randomly generate a 1,2, or 3 to represent the
computers choice.
4. Check game result: users choice vs. computers choice
Use an IF/ELSE-IF/ELSE-IF/ELSE branch to determine:
A tie
Computer win
User win
Invalid user input (not 1,2, or 3) this is considered a computer win.
List every possible condition in each branch. Be careful about the data types
E.g., if ((Computers choice is 1 && users choice is 1)||(both choices are 2)||(both
choices are 3)), it is a tie.
The conditions for user win
The conditions for computer win
Program Requirements RPS Game
Each match can have 1,3, or 5 RPS games (no other
numbers).
At the beginning of your program, ask the users to determine
the number of games for this match.
Each game is a regular RPS game.
Keep track of the number of wins for the computer and user so
that we can determine who the final winner is.
Program Requirements The Match
Announce the final winner after all games are played. In this
case, display something like Out of 5 games, the computer
won 2. You win!
Sometimes, we do not need to play all games.
For example: In a 3-game match (best of 3), when one side
wins the first and second games, there is no reason to play the
third game. Stop the match if additional games no longer
matter. Inform the user with a different message, something
like The computer has already won 2 out of 3 games and is
automatically declared the winner!
Program Requirements Final Winner

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 Programming Questions!