Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

.. Your task in this assignment is to create a class that will store playing car

ID: 3533527 • Letter: #

Question


..

Your task in this assignment is to create a class that will store playing card values that you will use to hold a deck of cards. Globally defined enumerated types: One type to store the plaving card suit, which can be CLUBS. DIAMONDS. HEARTS, or, SPADES. One type to store the plaving card rank, which can be one of the following: ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, or ACE. A class for a playing card type: It should have an appropriate class name like Card or PiayingCard or some other reasonable name, o Two private member variables which hold its rank and suit of the card, using the enumerated types defined above. Note that once you have created these enumeration types, you should use only the enumeration types (rather than the underlying numbers) wherever possible. Note that you can even use them in looping!! A default constructor that sets the member variable values to some default rank and suit of your choosing. A second constructor that sets both suit and rank to the values given as arguments. Be very careful to NOT shadow a member variable! To shadow a member variable means that you declare a new local variable or a parameter in a member function with the exact same name as the Warning member variable. Scoping rules allow this but references to a variable name will be to the one with the more local scope. Therefore, changes you make to a value of a variable are to the local version and NOT to the member variable. A void public member function that can be called to get input from the keyboard for the rank and suit of the current playing card. This function should allow the user to choose the rank and suit from menus and then use switch statements to set the values for the private member variables for rank and suit accordingly. Two public member accessor fimctions that returns the rank and suit of the card, using the appropriate enumeration type in each case. Use the convention that accessor functions begin with the word "get", such as get_r ank (), and that there is the keyword const to ensure that the member variables are not changed. Two void public member mutator functions that set the rank and suit of the playing card. Use the convention that mutator functions begin with the word "set", such as set_rank(). A void public member function that uses a switch statement to print the rank and suit of the current playing card to the screen. Be sure to build enor handling into your class so that cards cannot be set to a non-existent rank or suit. External fimctions (not member functions of the class): A function that, given an array of these card objects and the number of these cards as paramters, can shuffle the array, simulating shuffling a deck of cards. A function that will write out the entire anav of cards to the console for testing purposes. A main () function that tests all of the features of the class that you have implemented. It should do at least the following: Create a full deck of 52 playing cards by creating an anav of cards. Note that this anav holds members of the class. Displavs this "deck" to show that it is in order. Shuffles the "deck". Displays this "deck" again, hopefully showing that the deck is out of order. Ask the user how many cards will be in each hand. (You may assume that there will be no more than 13 cards per hand.) Deal a set of this number of cards to each of the four players, display what each hand holds in an easy to understand way.

Explanation / Answer

http://ideone.com/NBzygE

if you need any more help let me know.