You will construct two classes that represents an individual poker card and a complete 52 deck of cards. This lab is intended to prepare you for your next homework, so pay attention!
Below is a UML diagram representing the required classes:
We use the card class to represent an individual poker card. This includes:
Suit_t is an enum that contains the four poker suits: Club, Diamond, Heart, Spade.
Rank_t is an enum that contains all possible card ranks, e.g., 2-10, Jack, Queen, King, Ace.
The card class has two constructors: a default constructor that sets the initial value of the card's suit to be Club and rank to be 2. The second constructor accepts a suit and rank as input parameters.
Returns the card's Suit_t value in ENUM form.
Returns the card's Suit_t value in string form. E.g. "Ace" or "Clubs".
Returns the card's Rank_t in ENUM form.
Returns the card's Rank_t value in string form. E.g. "Two", or "Jack".
The deck class will be used to represent a standard 52 card poker deck. This includes:
This is an array of 52 unique cards.
This variable is used to track previously dealt cards. For ex, assuming that _cards represents the two of clubs, having putting a value of "1" inside _used_indices could indicate that the two of clubs has been dealt and cannot be used again until the deck gets reshuffled.
The Deck's constructor should initialize a fresh deck of 52 unique cards.
Calling this function will "zero out" _used_indices, which results in a fresh deck of cards.
This function will randomly select a card from _deck and return it to the user.