Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Youu should wrrite a Java program to meet the specification shown below. In this game(dice poker), the computer rolls two standard six-sided dice and you

Youu should wrrite 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.

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 Additional 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:

One 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

Crreate 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.

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

Principles of Geotechnical Engineering

Authors: Braja M.Das

8th edition

978-1285499963, 1285499964, 1133108660, 978-1133108665

More Books

Students also viewed these Programming questions