Question: This is to be written in Java... For this, I need to be able to use an array of Die instead of three variables... -->

This is to be written in Java...

This is to be written in Java... For this, I need to

For this, I need to be able to use an array of Die instead of three variables...

--> i need to use the Random vlass in Java (import java.util.Random)

--> need to declare object from class first:

--> call method on object with integer parameter to return beterrn 0 and parameter -1 .

--> basically if you want to generate a random number anf store it into variable that you already declared

ie: dieValue = randomNumbers.nextInt(6) + 1;

Output:

Your current pot is 100

Enter bet amount: 10

your dice are: 6 and 6, and 3

you win...double!

yout current pot is 120

Enter bet amount: 10

your dice are: 2, and 1 and 5

you lose your bet.

your current pot is 100..

....

[continues till user bets 0 (game over) or if the user ends up with 0 in their pot]

.This problem will simulate a game of Solitaire Dice (an invented game). You are welcome to customize the game to your own rules - just be sure to document them. However, you must meet the basic requirements which follow .The user will start with a pot of money of $100 In each play of the game, the player will o Enter a valid bet amount (less than or equal to the current pot, not negative, a bet of 0 means quit the game) o The game will then remove their bet amount from the pot o The game will then roll three die (simulate this using the Random class in Java, see below) display the values and add these values to a total. If all three die have the same value, then the player wins triple wins o Then, the game should adjust the pot in the following order of priority: their bet bachk double their bet back wins their bet back otherwise, the player has lost their money If two of the three die have the same value, then the player .If the total of the three dice is greater than 10, then the player The game will end with a bet of O OR when the pot reaches Design of this solution will involve three classes o Assign3 Game o Die

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!