Lab 1 - Playing Card C++ Class
Playing card class
As we go through the term, we will be developing an application for playing blackjack. Blackjack, of course, uses a normal deck of cards, so we will have to create a card deck. A deck of cards, of course, is composed of playing cards, so we will have to develop a class for a playing card. That's what this assignment is all about.
Cards have a value and a suit. We will use one character to specify the value of a card and one character to specify the suit of a card. The characters we use will be as follows:
Values	Suits	
A for an ace	C for clubs 	
digits 2 through 9 for their corresponding cards	D for diamonds 	
T for a ten	S for spades 	
J for a jack	H for hearts 	
Q for a queen		
K for a king		
If you wish, you can add the capability for the two jokers to the card class. The value for a joker will be 'Z', and the suit can be either 'R' or 'B' for red or black respectively.
If you add the joker capability, be sure that you don't allow the user to create a card with a wrong combination of suit and value. For instance, QB for "queen of black", or ZD for "joker of diamonds" would both be invalid. 
A whole deck would be:
AC 2C 3C 4C 5C 6C 7C 8C 9C TC JC QC KC
AH 2H 3H 4H 5H 6H 7H 8H 9H TH JH QH KH
AD 2D 3D 4D 5D 6D 7D 8D 9D TD JD QD KD
AS 2S 3S 4S 5S 6S 7S 8S 9S TS JS QS KS
ZB ZR
Any other cards would be illegal.
The only time your class should contain an invalid card is when the default constructor is used. The default constructor does not take values for the card value and the card suit. When the default constructor is used, the value and suit should both be '0'.
Implementation
You will create a header file and a cpp for the class declaration and definition. The class will be PlayingCard, the header file will be PlayingCard.h, and the source file will be PlayingCard.cpp
You must produce the public member functions outlined below and as described below. How you develop the private member variables and functions is up to you. But, you should do it clearly and efficiently.
You may choose to write your own driver for development and testing, but use the one I provide for the final test and submission to moodle. When your class is developed, your project should consist of the following files:
•	PlayingCard.h 
•	PlayingCard.cpp 
•	PlayingCardTest.cpp 
PlayingCardTest.cpp will be the driver I supply for you to use in testing. It is available on moodle. You may add to PlayingCardTest.cpp as long as it still contains all the original tests.
PlayingCardTest.cpp uses both arrays and pointers, so some of the code in it may seem alien. If you have created your class as outlined in the assignment, you won't need to make any modifications for it to work with PlayingCardTest.cpp.
public member functions
The public member functions will be as follows:
PlayingCard()
Default constructor, sets value to '0', sets suit to '0'
PlayingCard(char myValue, char mySuit) 
Overloaded constructor, checks for valid myValue and mySuit. If they are valid it sets value and suit to those values. If either of them is not valid, it sets them both to '0'.
bool SetCard(char myValue, char mySuit)
Checks for valid myValue and mySuit. If they are valid it sets value and suit to those values. If either of them is not valid, it returns false and does not change any values.
char GetValue()
Returns the card's value, one of A23456789TJQK (and Z if you are doing jokers).
char GetSuit() 
Returns the card's suit, one of CHDS (and BR if you are doing jokers).
string GetCardCode()
Returns a string containing the 2 characters associated with the card. For example for the 7 of spades it would return the string "7S". It does not include any spaces.
bool IsValid()
Returns true if the card is a valid card, false if it is not.
To Turn In
Zip your project and submit it to moodle. Your zip file should contain the following files:
•	PlayingCard.h 		 	class declaration
•	PlayingCard.cpp 		class implementation
•	PlayingCardTest.cpp 		main with test drivers
•	PlayingCard.cbp 		Code::Blocks project file
Submit your output as a separate file to moodle.
•	Your output 			text file showing output