Question: he player begins with $ 2 0 0 . 0 0 . The player is asked for a bet amount, and then a pair of

he player begins with $200.00. The player is asked for a bet amount, and then a pair of ten-sided dice are rolled. If the two values on the dice are the same (if the player rolled doubles), the player wins an amount equal to five times their bet amount. If the two values on the dice do not match, the player loses their bet amount. The game ends when either the player decides to end the game, or when the player runs out of money.
Program Requirements
Your program should have two classes:
Die Class Class that simulates a ten-sided die.
DoubleDice Class Class that contains game looping and logic.
Your Die Class should contain the following methods:
Constructor method: Initializes the dies value to 0 and instantiates the Random object.
roll() method uses the Random object to simulate a die roll between 1 and 10.
equals(Die die2) method returns Boolean true if both die have equal values, false otherwise.
toString() method returns the String one,two,three,four,five,six,seven,eight,nine, or ten depending on the value of the die.
Your DoubleDice Class should contain the following methods:
Contain main logic for playing the game.
Reference your Die Class and corresponding methods for die rolling.
May either have statements all in a main() method or split logic up in separate methods.

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!