Given these three classes Card, DeckOfCards, and DeckOfCardsTest. E - Given these three classes Card DeckOfCards and DeckOfCardsTest Extend the

Given these three classes Card, DeckOfCards, and DeckOfCardsTest. E

This preview shows page 1 - 4 out of 6 pages.

Given these three classes: Card, DeckOfCards, and DeckOfCardsTest. Extend the DeckofCards class to implement a BlackJack class, which implements a BlackJack game. Please do not use any java applet on the coding. Hint: Use a test class to test above classes. Pulic class Card { private final String face; // face of card ("Ace", �� "Deuce", ...) private final String suit; // suit of card ("Hearts", �� "Diamonds", ...) // two-argument constructor initializes card's face and �� suit public Card(String cardFace, String cardSuit) �� { �� this.face = cardFace; // initialize face of card �� ��� this.suit = cardSuit; // initialize suit of card �� ��� } �� // return String representation of Card �� public String toString() �� { �� return face + " of " + suit; �� ��� } �� } // end class Card ============================================= =============================================
================ import java.security.SecureRandom; class DeckOfCards { private Card[] deck; // array of Card objects �� private int currentCard; // index of next Card to be �� dealt (0-51) private static final int NUMBER_OF_CARDS = 52; // ��

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture