2
answers
1
watching
214
views

Hi. You should write a Java program to meet the specification shown below. 

In this game(dice poker), the computer rolls two standard six-sided dice and you bet on the outcome. The outcome is the configuration of the numbers rolled (explanation below). The input/output should utilise a graphical user interface (input and message boxes).

 

1.1 Game flow

You start with some money in your bank. You play a number of rounds, where for each round you place a bet and the computer rolls the dice, checks results and modifies your bank balance. After certain conditions, the game ends and you're presented with some final information shown as a message box.

 

1.2 Placing bets

Before the computer rolls the dice, you can bet some money from your bank.

ˆ If the numbers are sequential (e.g. 1 and 2, 5 and 4, etc. Not 6 and 1), you earn double your bet.

ˆ If the numbers are identical (rolling doubles), you earn triple your bet.

ˆ Otherwise, you win nothing therefore you lose the amount of money you bet.

Before placing a bet, the computer should inform you of your current bank balance.

 

1.3 Starting Game- Game rules

When the game starts you are given £6 in your bank. Each bet costs £1 and you are allowed to make up to five bets before the game ends. The game will end if you run out of money, or you have no more attempts left (you made all five bets). At the end of the game, you will be told which of these conditions has ended the game.

 

1.4 Results display

Once the game has finished (all bets have been placed or you ran out of money) the computer will collate and display the results in a single message box, comprised by:

ˆ On row per bet, displaying your bet, the numbers rolled, the amount of money earned or lost for that bet.

ˆ One row at the end, displaying the amount of money that you have remaining in your bank at the end of the game.

 

1.5..Variable bet amount

Allow the user to change how much they would like to bet and change the amount you win accordingly. Allow bets between £1 and 4£ (integers only)

 

1.6.High score table

Create a high score table. The more money you have remaining in your bank at the end of the game the higher up the table you will be. In order to implement this, players will have to enter their name before they play. The high score table should be displayed as a separate message box after the results have been displayed at the end of the game(1.4)

Not1: Please use JoptionPane class instead of scanner class. 

Not2: Also If possible explain the description of your classes: what each does and how they relate to each other. And if possible, program should be extensible. E.g. Is it easy to change the number of dice? The number of rounds to play? The sides of the dice?Etc.

For unlimited access to Homework Help, a Homework+ subscription is required.

Unlock all answers

Get 1 free homework help answer.
Already have an account? Log in
Avatar image
Read by 2 people
Already have an account? Log in

Weekly leaderboard

Start filling in the gaps now
Log in