Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are given the method that simulates a rock,paper, scissors game move and a method to determine which player wins. Now, write in main the
You are given the method that simulates a rock,paper, scissors game move and a method to determine which player wins.
Now, write in main the logic to let a human play against the computer. The program prompts the user to choose a move. The program randomly pick a move for the computer. The program then checks to see who is the winner. It prints the winner. If no one wins, it goes to the next round and repeat until one player wins.
Sample run : human wins
Human against computer.
Your move rockpaper,scissors: rock
Computer's move: scissors
You win.
Sample run : computer wins.
Human against computer.
Your move rockpaper,scissors: rock
Computer's move: paper
Computer wins.
Sample run : many rounds, but computer wins.
Human against computer.
Your move rockpaper,scissors: rock
Computer's move: rock
No one wins. Another round.
Your move rockpaper,scissors: rock
Computer's move: rock
No one wins. Another round.
Your move rockpaper,scissors: paper
Computer's move: scissors
Computer wins.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started