Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Rock, Paper, Scissors. Write a program that lets a user play Rock, Paper, Scissors against the computer. The program should ask the user to choose

Rock, Paper, Scissors. Write a program that lets a user play "Rock, Paper, Scissors" against the computer. The program should ask the user to choose one of the three choices, and then the computer randomly picks one (without knowing what the user has chosen).

Java Requirements: at least

- 1while-loop,

- 1 do-while loop,

- 1 boolean method .

- limit method length to 25 lines of code

image text in transcribed

Sample 1/0 Session Comments About I/O Session User is trapped in loop until they enter valid R,r, P, P, S, or s value. Both uppercase and lowercase input is allowed and valid. Type Rock), P(aper) or scissors): x Invalid answer. Re-type R, P or S: Y Invalid answer. Re-type R, Por S: Z Invalid answer. Re-type R, por S: r You played rock. The computer played rock. That round ended in a tie. Do you want to play another round? (Y/N) Y After user enters valid choice, A) tell them what they played. B) tell them what random choice the computer played and C) tell them who won the round. Separate each round by a blank line. Type Rock), P(aper) or scissors) : P You played paper. The computer played rock. Yippee! You won that round. Do you want to play another round? (Y/N) Y fUse a loop to allow user to control the number of rounds of the game that get played. Both uppercase and lowercase input is allowed. Type Rock), P(aper) or scissors): S You played scissors. The computer played rock. Rats! The computer won that round. Do you want to play another round? (Y/N) Y Keep track of how many rounds computer and user each win. Type R (ock), P(aper) or scissors): S You played scissors. The computer played rock. Rats! The computer won that round. Do you want to play another round? (Y/N) N Stop playing when user indicates that they want to quit. Display user and computer wins and tell who won the game. Use 's' after round" when win count # 1. You won 1 round. The computer won 2 rounds. Rats! The computer won the game

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions

Question

5. Refer the customer to relevant colleagues:

Answered: 1 week ago

Question

2. Place a value on the outcomes.

Answered: 1 week ago