Question: Need help 3. [30 points] Write a Java program RockPaperScissor that plays the rock-paper-scissor game (scissor cuts/beats paper, rock breaks/beats scissors, paper covers/beats rock). The

Need help

Need help 3. [30 points] Write a Java program RockPaperScissor that plays

the rock-paper-scissor game (scissor cuts/beats paper, rock breaks/beats scissors, paper covers/beats rock).

3. [30 points] Write a Java program RockPaperScissor that plays the rock-paper-scissor game (scissor cuts/beats paper, rock breaks/beats scissors, paper covers/beats rock). The program randomly generates a number 1, 2, or 3 representing rock, paper and scissons The program prompts the user to enter a number 1, 2, or 3 (rock, paper, scissors) and displays a message indicating whether the user or the computer wins, loses, or draws Here are sample runs Enter rock (1), paper (2), scissors (3) 1 The computer is scissor. You are rock. You win. Enter rock (1), paper (2), scissors (3): 2 The paper. You are paper. It is a draw computer is Here is a pseudocode algorithm for the RockPaperScissor game Prompt user for a number (1-Rock, 2-Paper, 3-Scissor) Generate a random number between 1 and 3 inclusive Display a message with player's number and computer's number If (player Throw 1 and computer Throw 1) Output Draw message Else if (player Throw 1 and computerThrow : 2) Output Computer wins message Else if (player Throw 1 and computer Throw - 3) Output Player wins message If (player Throw2 and computer Throw 1) Else if (player Throw 2 and computer Throw - 2) Else if (player Throw 2 and computer Throw 3) Output Player wins message Output Draw message Output Computer wins message If (player Throw 3 and computer Throw 1)

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!