Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 $ The player is asked for a bet amount, and then a pair of tensided 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 tensided 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 and instantiates the Random object.
roll method uses the Random object to simulate a die roll between and
equalsDie die method returns Boolean true if both die have equal values, false otherwise.
toString method returns the String onetwothreefourfivesixseveneightnine 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started