Okay I have no idea what Im doing could someone please show
Okay, I have no idea what I\'m doing, could someone please show me where to start, help me get the code down something! I\'m struggling so bad.
Class Card
It has a suit and a rank.
o Suit should be declared from an enumerate data type that you build which allows
JOKER, CLUBS,DIAMONDS,HEARTS,SPADES
o Rank can be an integer from 0 to 13, Assign Aces the rank of 1.
The default constructor will create a JOKER with a rank of 0
A parameterized constructor that accepts rank and suit for convenience.
o Throw an exception if the input is not correct.
Be sure to have set and get methods. The set methods should be private to prevent
someone from changing the card.
The Card class should provide a method to returns its description in a string object. That
is it will have a ‘toString() method that returns a string object that looks like: Ace of Hearts
Seven of Clubs.
Joker
Be sure to test each method you create. I know it will be difficult to test the private set
methods. Have the parameterized constructor call them.
With the toString() function, the Card object should be easy to print. Test with
cout<<Card.toString()
Remember this should have both a specification file (.h) and an implementation file
(.cpp)
The enum for the suits should be declared outside the class (in the header file). This is to
be sure it is available others needing it.
Main Program
The main or driver program create an array of 52 cards and print them. Randomly pick a card and print it.
makefile
Please include a makefile for compilation. There will be 3 files in it!
Solution
#include
