Question: This is java programming on eclipse Create a Roshambo game Console Welcome to the game of Roshambo Enter your name: Joel Would you like to

This is java programming on eclipse

Create a Roshambo game

Console

Welcome to the game of Roshambo

Enter your name: Joel

Would you like to play Bart or Lisa? (b/l): b

Rock, paper, or scissors? (r/p/s): r

Joel: rock

Bart: rock

Draw!

Play again? (y/n): y

Rock, paper, or scissors? (r/p/s): p

Joel: paper

Bart: rock

Joel wins!

Play again? (y/n): y

Rock, paper, or scissors? (r/p/s): s

Joel: scissors

Bart: rock

Bart wins!

Play again? (y/n): n

Operation

The application prompts the player to enter a name and select an opponent.

The application prompts the player to select rock, paper, or scissors. Then, the application displays the players choice, the opponents choice, and the result of the match.

The application continues until the user doesnt want to play anymore.

If the user makes an invalid selection, the application should display an appropriate error message and prompt the user again until the user makes a valid selection.

Specifications

Create an enumeration named Roshambo that stores three values: rock, paper, and scissors. This enumeration should include a toString method that can convert the selected value to a string.

Create an abstract class named Player that stores a name and a Roshambo value. This class should include an abstract method named generateRoshambo that allows an inheriting class to generate and return a Roshambo value. It should also include get and set methods for the name and Roshambo value. (10 points)

Create classes named Bart and Lisa that inherit the Player class and implement the generateRoshambo method. The Bart class should always select rock. The Lisa class should randomly select rock, paper, or scissors (a 1 in 3 chance of each).

Create a class named Player1 that inherits the Player class and implements the generateRoshambo method (even though it isnt necessary for this player). This method can return any value you choose.

Create a class named RoshamboApp that allows the player to play Bart or Lisa as shown in the console output. Rock should beat scissors, paper should beat rock, and scissors should beat paper.

Use the Console class described in chapter 8 or a variation of it to get the users entries.

Welcome to the Invoice calculator Enter customer type(r/c) : r Enter subtotal 100 Invoice Subtotal: $100.00 Discount percent 10% Discount amount $10.00 Total before tax t $90.00 Sales tax $4.50 Invoice total: $94.50 continue? (y/n) n Bye!

The nested iflelse statement that determines the discount percent double discount Percent =0 if(customer Type equal Ignore Case("r")) { if(Bubtotal <100) discount Percent 0.0 ; } else if (subtotal >= 100 && subtotal < 250) { discount Percent = .1! } else if(subtotal >= 250) { discount Percent = .2; } } else if(customer Type.equalsIgnorecase ("c ") ){

if(subtotal < 250) {

discount percent = .2; } else if (subtotal >= 250) {

discount percent = .3; } } else { discount percent = .11; }

Enhancement

Keep track of wins and losses and display them at the end of each session.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!