Question
To do in Java: Write a program named RPS.java . This is the old rock, paper, scissors game. Follow these steps: When the program begins,
To do in Java: Write a program named RPS.java. This is the old rock, paper, scissors game. Follow these steps:
When the program begins, a random number in the range of 1 through 3 is generated for the computer choise. 1=rock 2=paper 3=scissors.
Ask the user for their choice as the words rock, paper or scissors.
Display the computers choice.
Select a winner according to the following rules:
If one player chooses rock and the other is scissors, rock smashes scissors and wins
If one player chooses scissors and the other player chooses paper, scissors cuts papers so scissors wins
If one player chooses paper and the other chooses rock, paper wraps rock and paper wins
if both players make the same choice, the game continues and neither wins that round
Repeat the loop five times and then indicate how many times the computer won, how many times the user won, and the grand winner.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started