In this problem, you'll play a simple rock, paper, scissors game. First, you'll ask the user to pick rock, paper, or scissors. Then, you'll have the computer randomly choose one of the options. After that, print out the winner! You should keep playing the game until the user hits enter. Note: You'll need to implement a method called `String getWinner(String user, String computer)`. Luckily, you just wrote that in an earlier program! Here is a sample run of the program. ``` Enter your choice (rock, paper, or scissors):rock User: rock Computer: paper Computer wins! Enter your choice (rock, paper, or scissors):paper User: paper Computer: scissors Computer wins! Enter your choice (rock, paper, or scissors):scissors User: scissors Computer: paper User wins! Enter your choice (rock, paper, or scissors):rock User: rock Computer: rock Tie Enter your choice (rock, paper, or scissors): Thanks for playing! ```
Sign up for a free teacher account to get access to curriculum, teacher tools and teacher resources.
Teacher SignupSign up as a student if you are in a school and have a class code given to you by your teacher.
Student Signup