Question: Write the program in C++ programming Object Oriented Create a Card class with the following data members: int rank (1 for ace) string suit (e.g.

Write the program in C++ programming Object Oriented

Write the program in C++ programming Object Oriented Create a Card class

with the following data members: int rank (1 for ace) string suit

Create a Card class with the following data members: int rank (1 for ace) string suit (e.g. spades, hearts, clubs, diamonds) Note: string here is the standard c++ string class Create a Deck class that has the following data members: Card desk[52] int current Each of these should be canonical classes meaning each class will have a default ctor, dtor, copy ctor, and copy assignment operator. Move semantics implementation aren't required for this lab (either use = default or provide an implementation). The default deck constructor should create a standard poker deck of cards. In addition to the default constructor for the Card class, the Card class should have a 2 arg constructor that takes rank and suit parameters, which uses those values to initialize the data members. In addition to the normal/expected behavior for each of the manager functions (and the Card 2 arg ctor) it should output the appropriate message from this list: Class Function Message Card Default constructor Card default ctor Card Copy constructor Card copy ctor Card Destructor Card dtor Card Card copy assignment Card Copy assignment operator Move constructor (if you choose to provide an implementation) Move assignment operator (if you choose to provide an implementation) Card move ctor Card Card move assignment Card 2 argument constructor Card 2 arg ctor Deck Default constructor Deck default ctor Deck Copy constructor Deck copy ctor Deck Destructor Deck dtor Deck Copy assignment operator Deck copy assignment Deck Deck move ctor Move constructor (if you choose to provide an implementation) Move assignment operator (if you choose to provide an implementation) Deck Deck move assignment Create a driver file/program that does the following: 1. Instantiates two Cards. Use different constructors. 2. Declares an array of three elements of your Card class. 3. Declares a pointer to your Card class. (Do not allocate memory.) 4. Instantiate a Card object that uses another object for initialization. 5. Allocates memory for the pointer (from #3). 6. Pass a Card by value to a function. 7. Pass a Card by pointer to a function. 8. Pass a Card by reference to a function. 9. Pass a Card by const-ref to a function. 10. Pass the array to a function. 11. Create a function that instantiates a local Card object and then returns that object from the function. 12. Instantiates a Deck object using its default constructor. 13. Deallocates the memory referenced by the pointer. 14. Return a Deck by value from a function. 15. Pass a Deck by value to a function. To make the output more clear - in the driver file please output the step number before executing the content of the step. For example, for the step "1. Instantiates two Cards. Each one will call a different ctor." please output a "1" on its own line and then have the code that calls the 2 different Card ctors. Example output: Card default ctor Card copy ctor 2

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!