Question: Write a Java program that allows the user to play the game or Rock, Paper Scissors 5 times. Remember: Rock crushes scissors, Scissors cuts paper,

Write a Java program that allows the user to play the game or Rock, Paper Scissors 5 times. Remember: Rock crushes scissors, Scissors cuts paper, Paper hides rock.

Enter 1 for Rock, 2 for Paper, 3 for Scissors

1 Player picked Rock, Computer Paper. Computer wins Enter 1 for Rock, 2 for Paper, 3 for Scissors 2 Player picked paper, Computer Scissors. Computer wins Enter 1 for Rock, 2 for Paper, 3 for Scissors 3 Player picked Scissors, Computer Paper. Player wins Enter 1 for Rock, 2 for Paper, 3 for Scissors 1 Tie Enter 1 for Rock, 2 for Paper, 3 for Scissors 2 Player picked paper, Computer Scissors. Computer wins Computer wins: 3 Player wins: 1 here an example

computer = (int)(Math.random() * 3) + 1; //computer choice System.out.println("Enter 1 for Rock, 2 for Paper, 3 for Scissors"); player = reader.nextInt(); //player choice //Complete the code to determine who wins and add to computer or player score //Rock crushes scissors, paper hides rock, scissors cuts paper // if player is equal to computer => tie // if player picks Rock then // if computer choice is paper, computer wins // if computer choice is scissors, player wins // otherwise if player picks paper then // if computer choice is rock,player wins // if computer choice is scissors, computer wins // otherwise if player picks scissors then // if computer choice is rock, computer wins // if computer choice is paper, player wins // otherwise, the player picked an invalid choice. Do not count the game. //End of loop here. //print number of computer wins and player wins

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!