At the start of the program, it will ask the player how many rounds of Rock-Paper- Scissors they want to play. After this, the game will loop for that many number of times. Each loop, it will ask the player what item they want to use – Rock, Paper, or Scissors. The computer will randomly generate its own item, and a winner will be determined. The game will then save the result as an element of an array, and the next round will begin. Once all the rounds have been played, the program will say "Game Over" and display a list of who won each round, in order. Hints: While the random functions we've discussed thus far can't generate words, we can associate numbers with them instead. For example, we might treat the computer randomly generating 0 as if it threw Rock. We could then use that number to access a predefined String array with "Rock", “Paper", and "Scissors" stored inside it. Sample Output #1: How many games do you want to play?: 3 Round 1: What do you want to throw?: Rock Computer threw SCISSORS! Round 2: What do you want to throw?: Paper Computer threw PAPER! Round 3: What do you want to throw?: Rock Computer threw PAPER! Game Over... Here's the recap: Player won Round 1 Tied on Round 2 Computer won Round 3 Sample Output #2: How many games do you want to play?: 2 Round 1: What do you want to throw?: Scissors Computer threw ROCK! Round 2: What do you want to throw?: Paper Computer threw SCISSORS! Game Over... Here's the recap: Computer won Round 1 Computer won Round 2

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Modularization Techniques
Section: Chapter Questions
Problem 2GZ
icon
Related questions
Question

in java please

At the start of the program, it will ask the player how many rounds of Rock-Paper-
Scissors they want to play. After this, the game will loop for that many number of times.
Each loop, it will ask the player what item they want to use – Rock, Paper, or Scissors.
The computer will randomly generate its own item, and a winner will be determined.
The game will then save the result as an element of an array, and the next round will
begin.
Once all the rounds have been played, the program will say "Game Over" and display a
list of who won each round, in order.
Hints: While the random functions we've discussed thus far can't generate words, we
can associate numbers with them instead. For example, we might treat the computer
randomly generating 0 as if it threw Rock. We could then use that number to access a
predefined String array with “Rock", “Paper", and "Scissors" stored inside it.
Sample Output #1:
How many games do you want to play?: 3
Round 1: What do you want to throw?: Rock
Computer threw SCISSORS!
Round 2: What do you want to throw?: Paper
Computer threw PAPER!
Round 3: What do you want to throw?: Rock
Computer threw PAPER!
Game Over...
Here's the recap:
Player won Round 1
Tied on Round 2
Computer won Round 3
Sample Output #2:
How many games do you want to play?: 2
Round 1: What do you want to throw?: Scissors
Computer threw ROCK!
Round 2: What do you want to throw?: Paper
Computer threw SCISSORS!
Game over...
Here's the recap:
Computer won Round 1
Computer won Round 2
Transcribed Image Text:At the start of the program, it will ask the player how many rounds of Rock-Paper- Scissors they want to play. After this, the game will loop for that many number of times. Each loop, it will ask the player what item they want to use – Rock, Paper, or Scissors. The computer will randomly generate its own item, and a winner will be determined. The game will then save the result as an element of an array, and the next round will begin. Once all the rounds have been played, the program will say "Game Over" and display a list of who won each round, in order. Hints: While the random functions we've discussed thus far can't generate words, we can associate numbers with them instead. For example, we might treat the computer randomly generating 0 as if it threw Rock. We could then use that number to access a predefined String array with “Rock", “Paper", and "Scissors" stored inside it. Sample Output #1: How many games do you want to play?: 3 Round 1: What do you want to throw?: Rock Computer threw SCISSORS! Round 2: What do you want to throw?: Paper Computer threw PAPER! Round 3: What do you want to throw?: Rock Computer threw PAPER! Game Over... Here's the recap: Player won Round 1 Tied on Round 2 Computer won Round 3 Sample Output #2: How many games do you want to play?: 2 Round 1: What do you want to throw?: Scissors Computer threw ROCK! Round 2: What do you want to throw?: Paper Computer threw SCISSORS! Game over... Here's the recap: Computer won Round 1 Computer won Round 2
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 5 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,