Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

The 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

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

Oracle Database 10g Insider Solutions

Authors: Arun R. Kumar, John Kanagaraj, Richard Stroupe

1st Edition

0672327910, 978-0672327919

More Books

Students also viewed these Databases questions

Question

5. Identify three characteristics of the dialectical approach.

Answered: 1 week ago

Question

7. Identify six intercultural communication dialectics.

Answered: 1 week ago