Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Graphics Expert

BlackJack is a popular card game played in many casinos. The player plays against the dealer aiming to reach 21 points, or a score higher than the dealer without exceeding 21. The values of the cards in Blackjack are as follows: Ace can be either 1 or 11 points (player's choice), face card (i.e., Jack, Dame, and King) are 10 points, and all the remaining cards have their scores equal to their numbers (e.g., 2 is 2, 3 is 3, and so on). The game can be played with one or several decks of 52 cards. In our version of Blackjack, we will use a single deck of 52 cards.

In this assignment you will implement a simplified version of Blackjack, which is as follows. The player and the dealer are initially dealt 2 cards each with one of the dealer's card (called a hole card) being dealt face-down, and the other one face up. Both of the player's cards are being dealt face-up. The player can then choose to ask the dealer to repeatedly hit his hand by dealing him one card at a time until either the value of the player's hand exceeds 21, in which case the player is "busted", and loses immediately, or the player decides to "stand". If the player stands, the dealer reveals its hole card, and proceeds by dealing himself more cards until the value of his hand is 17 or higher. At this point, if the value of the dealer's hand is higher than 21, then the dealer is busted, and loses immediately. Otherwise, the values of the player's and the dealer's hands are compared against each other, and the hand with the higher value wins. The ties are resolved in favor of the dealer.

The game's graphical user interface (GUI) is already implemented by code in the template, and will appear on the screen when you run it.

The game's GUI consists of the following elements:

  • three buttons: "Deal", "Hit", and "Stand",
  • text labels for displaying the score,
  • text labels demarcating the player's and dealer's areas of the game table.

Focus on the code appearing in the following four classes: Card, Deck, Hand, and BlackJack (which is the main game's class). 
First, review the class definitions for Card and Hand. Note that a hand is modeled as a linked list of cards. Implement the following methods of the Hand class:

  • addCard: adds a card to the hand
  • Value: returns the total value of the cards in the hand
  • Busted: returns true if and only the hand's total value exceeds 21

 

Computer Graphics, Computer Science

  • Category:- Computer Graphics
  • Reference No.:- M9622488

Have any Question?


Related Questions in Computer Graphics

You have a program draw a rectangle on the screen and allow

You have a program draw a rectangle on the screen and allow the user to change the color/size of the rectangle. The program will store in the browser the settings of the color/size so that upon revisiting the page, the v ...

Question a describe the architecture of simple raster

Question : a) Describe the architecture of simple raster graphics system? b) Explain raster scan display processor?

The problemyou are to search a bitmap in rgb format and

The problem: You are to search a bitmap in RGB format and count the number of pixels which match a set of colors. The bitmap will be 1024 by 1024 pixels for the purposes of explaining this problem. The set of colors will ...

The saffir-simpson hurricane scale classifies hurricanes

The Saffir-Simpson Hurricane Scale classifies hurricanes into five categories numbered 1 through 5. Write an application named Hurricane that outputs a hurricane's category based on the user's input of the wind speed. CA ...

Please read my question if you post copy and pasted code

Please read my question if you post copy and pasted code you will get a negative review. This is java In this graphical program, you are going to simulate arcade car racing game. You need a single player that is movable ...

The problemsit is strongly recommended that you tackle the

The problems: It is strongly recommended that you tackle the following tasks in a modular way -- a separate standalone function for each task. Draw a rectangle as a Rectangle and as a Polygon. Make the lines of the Polyg ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As