Start by downloading
a ZIP file containing
an almost complete NetBeans project
Unzip this file into your
start up NetBeans and load the project.
Congrats!!! You have been hired to work as a collaborator on a project to implement the card game BlackJack.
Note that your coworkers have already implemented the main class
Blackjack and the classes
They have also started work on the
BlackjackHand class which you must complete
according to the following design:
- Create three instance variables:
cards: an array of
PlayingCardrepresenting a hand of cards. The hand can hold at most five cards.
numCards: number of cards currently in the hand
DeckOfCardsobject for which cards are dealt.
- Complete the constructor method
BlackjackHand(DeckOfCards). The constructor should use its
DeckOfCardsparameter to initialize the
deckinstance variable and place two cards of the deck into the hand of cards. The number of cards should be two at this point.
- Complete five methods:
public int valueOfHand(): returns point value of hand
public int sizeOfHand(): returns number of cards in hand
public void hitMe(): adds a card to the hand
public PlayingCard mostRecent(): returns the most recent card added to hand
public void printHand(): prints the cards in the hand.
In Java files of the project each method is proceeded by comments offering implementation hints and tips. Read these carefully.
Implement and test your code. Submit only your BlackjackHand.java file.