Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Chapter 5, you created a Rock Paper Scissors game. In the game, a player entered a number to represent one of the three choices.

In Chapter 5, you created a Rock Paper Scissors game. In the game, a player entered a number to represent one of the three choices. Make the following improvements to the game:

Allow the user to enter a string ("rock", "paper", or "scissors") instead of a digit.

Make sure the game works correctly, whether the player enters a coice in uppercase or lowercase letters, or a combination of the two.

To allow for player misspellings, accept the player's entry as long as the first two letters are correct. (In other words, if a player types "scixxrs", you will accept it as "scissors" because at least the first two letters are correct.)

When the player does not type at least the first two letters of the choice correctly, reprompt the player and continue to do so until the player's entry contains at least the first two letters of one of the options.

Allow 10 complete rounds of the game. At the end, display counts of the number of times the player won, the number of times the computer won, and the number of tie games.

Save the file as RockPaperScissors2.java.

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

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions