Black Jack Game

 

In the Share folder download the Black Jack Game folder.

 

You will need to do the following to complete this project:

 

Dealer Class:

You will need two private variables – one to hold the value of the dealer’s hand, and a random number to choose which card the dealer gets.

 

In the getCard method, you will use your random to generate a number from 1 to 13.  You will use that number to create a new card (1=ace, 11=jack, 12=queen, 13=king).

 

In the addToHand method, you will have to add the value of the card the dealer was dealt to his current hand.  For the ace - if his current hand value is greater than 10 just add 1 to his hand, but if it is less add 11.  Remember all of the face cards have a value of 10.

 

Add the getHand method which will return the total value in your hand.

 

Card Class:

You will need two private variables – one to hold the value of the card, and one to determine if it is or isn’t an ace.  Correctly fill in the constructor and add accessor methods for these two variables.

 

Player Class:

The player needs just one private variable to determine how much his hand is worth.  In the constructor, that variable should be set to 0 so that he starts with nothing.

 

The addToHand method works the same as in the dealer class, and you will need the getHand accessor method.