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

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!