Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

Evaluate 3x - x for x = -2 Answer:

Answered: 1 week ago

Question

What is group replacement? Explain with an example. (2-3 lines)

Answered: 1 week ago