Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions

Question

what do you want to pursuw a career in coding?

Answered: 1 week ago