Data, Data, Data
Challenge
Represent a deck of cards. Each card in the deck has a suit (hearts, diamonds, spades, or clubs) and a card face (Ace, 1 through 10, Jack, Queen, and King). There are a total of 52 unique cards in a deck.
Guiding Questions
- If a card has a suit, card face, and card value, what data types could you use to represent a single card?
- How can we group the features of a card together?
- How can you use
enum
in the design of a card?
- Would you want to use a record or a class to represent a card?
- How can you create a deck of cards?
Watch the Recording
Resources