Blackjack Game HELP

In need of help with basic blackjack game

Page 1 of 1

2 Replies - 4034 Views - Last Post: 06 October 2010 - 09:02 PM Rate Topic: -----

#1 benie8  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 06-October 10

Blackjack Game HELP

Posted 06 October 2010 - 08:49 PM

Hey guys i gotta write this game and i have no idea how to do it. Attached is a copy of all the files im given including all the constructor and method details etc. Below is the instuctions of what i have to do. any help would be greatly appreciated.

Assignment Overview

You are required to write a basic game representing a simplified version of the game Black Jack.

In this simplified version the casino will only use a single deck of cards and the deck will be reset after each hand.

Game Overview
As a way to relax in your free time, you and your class mate have decided to go to a local casino to play some Black Jack. Before commencing the game, you are required to register your names at the casino, at which point you and your friend will be given an allowance to spend at the tables in the casino. As space is limited in this casino, there are only two playing tables available. To sit at any given table both players must at least have an allowance greater or equal to the minimum bet specified by that table.
Once seated at a table, each player can chose to participate in a hand (betting) or chose to spectate. Both players will remain at the table, until either one player has less than the minimum bet or you decide to leave the table at the end of a hand. Due to your close friendship, both players must remain together at all times.

Hand Overview
At the start of a hand, each player has the choice of whether they wish to bet and the amount to bet. This bet must be equal to or above the minimum bet specified by the table. For our needs your maximum bet is only limited by your allowance (this is a rich casino). The dealer will then deal a single card face up to each player that has placed a bet (including themself). The second card won’t be given to a player until it is their turn to act (this reduces the amount of information available on the table).
Each active player has the option to act. Their aim is to get to 21 without going over. They can chose to either hit (receive another card) or sit (not receive any more cards). In our version of the game, the player can only receive a maximum of 5 cards at which point they must sit. If a player goes over 21, they are bust and automatically lose the hand. There is no need to handle splitting (see YouTube video or Wikipedia) in this assignment.
Note: All values of 21 will be considered equal, no matter what cards are used.
After each player has acted, the dealer must keep hitting until they are greater than or equal to 17, at which point they must sit. The dealer’s hand is then compared to each active player (a show down). The rules behind a show down are determined in the following order.
1) If a player has busted they automatically lose their bet.
2) If the dealer has busted the player automatically wins double their bet.
3) If the dealer has a stronger hand the player loses their bet.
4) If the dealer has a hand equal to the player, it is a draw (push) and the player gets their bet back.
5) If the player has the stronger hand they have won and they get double their bet back.
Note: To determine the strength (total value) of a hand the following rules apply: cards 10, Jack, Queen, and King all have the value 10 and can be considered equivalent in comparing hands. Any Ace will be treated as 11 if the hand strength adds to 21, otherwise they will be given a value of 1. All other cards have theur expected values.

Program Structure
Your program should consist of the following classes:
1) Card class, which represents a single card in a deck of cards. The card class you wrote in Prac7 should contain most of the desired functionality.
2) Player class, which manages the players in the game. It stores the players’ full name, their current allowance and their current bet value. Additionally it will store an array of cards which will have an upper limit of 5. The default allowance for a player is $100.00. The player class you wrote in Prac 8 should provide you with a supportable base to get you started.
3) Deck class, used to represent a single deck of cards. The deck class you wrote in Prac 10 should contain most of the desired functionality.
4) Table class, used to represent a single table at our casino. It stores the table name (eg: “High rollers table”), the minimum bet, the dealer (which is represented as a player that doesn’t bet) and the current players at the table as an array. Only two players can sit at any given table. The table should also keep track if a hand is currently in progress.
5) Casino class, which is the main game logic. This casino has only one deck of cards and players can only play at one table at a time.
We have provided sample documentation to assist you in writing these classes. However, you are welcome to design and implement your methods different to the provided documentation.
This structure allows you to write some basic multi-purpose classes (Player, Deck, and Card) that could be used for other games without the need to change them (keep that in mind).

Part 1: Class Diagram
As a first task it is important to understand and document the program design. Read the whole assignment specification and draw a class diagram to represent the program design. Include all five classes, attributes, and methods required.
Part 2: Card Class
1) Implement the Card class, including the relevant attributes, accessors, mutators, toString and constructor. The constructor should receive two parameters including the suit and value, these values should be validated.
2) Write a test driver to test that a Card object can be successfully created and functions correctly.
Part 3: Player Class
1) Implement the Player class, including the relevant attributes, accessors, mutators, methods and constructor. Its constructor should be designed such that it accepts a player name and allowance given to the player (this is to make the game more flexible). Both these values should be validated and if invalid should be given sensible default values. These default values should be defined as constants.
2) Use the test driver you wrote in Prac 8 to test the functionality of this class.
Part 4: Deck Class
1) Implement the Deck class, including the relevant attributes, accessors, mutators, methods and constructor. The constructor automatically populates its card array with unique Card objects. Other functionality should include having a method that always returns a unique card and removes it from the deck. Once the deck is empty it should return null.
2) Use the test driver you wrote in Prac 10 to test the functionality of this class.
Part 5: Table Class
1) Implement the Table class, including the relevant attributes, accessors, mutators, methods and constructor. Its constructor should be designed such that it accepts a table name and the minimum bet allowed at that table. Both these values should be validated and if invalid should be given sensible default values. These default values should be defined as constants.
2) Write a test driver to test that a Table object can be successfully created and functions correctly. Ensure that you test the validation of each method (including the constructor) and that the toString() returns the correct String.
Part 6: Casino Class
Write a main program class called Casino to allow a user to play the game. Your game will need to emulate the functionality described in the game and hand overview above.
Refer to the provided sample output text file as a walkthrough of how the game should function. This output is provided as an example only; your program’s output does not need to match the sample.

Attached File(s)



Is This A Good Question/Topic? 0
  • +

Replies To: Blackjack Game HELP

#2 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon



Reputation: 2870
  • View blog
  • Posts: 11,025
  • Joined: 15-July 08

Re: Blackjack Game HELP

Posted 06 October 2010 - 09:00 PM

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.

We won't write your code. That was the first thing you saw when you posted. Please :code: and tell us what you're having issues with.
Was This Post Helpful? 0
  • +
  • -

#3 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8327
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Blackjack Game HELP

Posted 06 October 2010 - 09:02 PM

We don't download attachment here. What we'll be the pedagogic use of it if others cannot see what your problem was and how we fixed it.

Please post you code using

:code:

And try to narrow your problem.
Post the errors you've get.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1