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 (1 point)
The constructor will create a full 52-card deck of cards. 2,3,4,5,6,7,8,9,10, 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. (0.8 points)
The destructor will free the memory associated with each Card instance. (0.8 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. (0.8 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. (0.8 points)
Write a main function (0.8 points) that does the following:
Creates a deck of cards.
Shuffles the deck.
Draws 10 cards and prints each one.
Reshuffles the deck.
Draws 10 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!