Question: You will create a Deck class as follows: Compiles without error ( 1 point ) The constructor will create a full 5 2 - card
You will create a Deck class as follows:
Compiles without error point
The constructor will create a full card deck of cards. Jack, Queen, King, Ace for each suit: Clubs, Diamonds, Hearts, Spades. Each card will be created on the heap and the deck will be stored using an STL vector of Card pointers. points
The destructor will free the memory associated with each Card instance. points
A shuffle method will shuffle the Card pointers into an STL stack. Note that only the pointers will be added to the stack. Shuffle may be called at any time to "reshuffle". Reshuffling clears the stack and repopulates with the full deck. points
A draw method will allow the caller to receive a pointer to the Card on the top of the shuffled deck. The Card will be popped from the stack. points
Write a main function points that does the following:
Creates a deck of cards.
Shuffles the deck.
Draws cards and prints each one.
Reshuffles the deck.
Draws cards and prints each one.
You will turn in the following files. Please ZIP them into an archive before uploading.
card.h
card.cpp
deck.h
deck.cpp
main.cpp
Please show these and how the code in each works together to execute a cohesive program.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
