Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help to write this program! Problem Description: Using the steps for Prob

ID: 3764438 • Letter: I

Question

I need help to write this program! Problem Description: Using the steps for Problem Solving - generate for the following problem: A) write and test the program code in Java.

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 $50.

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). The game will then remove their bet amount from the pot The game will then roll three die (simulate this using the Random class in Java) display the values and add these values to a total. Then, the game should adjust the pot in the following way:

If the total of the three dice is greater than 12, then the player wins their bet back.

If two of the three die have the same value, then the player wins double their bet back.

If all three die have the same value, then the player wins triple their bet back.

Otherwise, the player has lost their money.

The game will end with a bet of 0 OR when the pot reaches 0.

Design of this solution will involve three classes:

Die class – this class will represent ONE die – with a field of dieValue, a constructor, methods rollDie()(which gets random value as rolled value and returns it) and displayDie()

Game class – this class will represent the game- with fields of potAmount and betAmount and a constructor, methods getBetAmountFromUser(), and playGame().Note the playGame() method will have three local reference variables referring to three different objects of Die class to represent the three dice in the game.

Assign3 class – this class will be the "driver" class and have method main which will create an object of Game class, and execute the playGame() method

Sample Output : (blue indicates user entered information)

Welcome to Solitaire Dice Game. Bet an amount - if the sum of the three die is greater than 12, you keep your bet, if you roll doubles you win double your bet, if you roll triples you win triple your bet, otherwise you lose your bet. A bet of 0 ends the game. Your current pot is 50 Enter your bet amount: 10 Your die are: 3 and 6 and 5 You WIN...your bet back

Your current pot is 50 Enter your bet amount: 10

Your die are: 3 and 6 and 6 You WIN....double your bet

Your current pot is 60 Enter your bet amount: 10

Your die are: 6 and 4 and 6 You WIN....double your bet

Your current pot is 70 Enter your bet amount: 100

Error - cannot bet less than 0 or more than 70...

Enter your bet amount: 60

Your die are: 1 and 6 and 2 You LOSE....your bet

Your current pot is 10

Enter your bet amount: 0

You end the game with pot of 10

Explanation / Answer

Here is the code for you.

https://www.dropbox.com/sh/a4l0aiqcxe61vmn/AABjIfmAVhOi9_V6KZeP8Vqza?dl=0

If you have any further queries, just get back to me.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote