A paper copy of your program should be turned in at the beginning of
class.
Your work should be dropped off electronically in the Lamont folders by
10:00 AM on the due date.
Late Deadline: turn in by Midnight Friday Feb. 29 for a 10% penalty.
(Paper on my office door.)
For further details on how to hand in assignments, see these Submission
Guidelines.
Write a program that
- creates (and then displays)
an ordererd deck of cards
- shuffles (and then displays)
the deck
- then deals the shuffled cards
into 4 hands in the usual moving-around-the-table rotation
- and finally, displays each hand.
You should write the following classes
- a single card (this will have a value
and a suit)
- a set of cards (this will have an
array of card objects)
The single card class should be able to
- create a card from a given value and
suit
- answer questions about a card's value
(getValue) and suit (getSuit)
- display a card (Your
playing cards, when displayed, must use A,J,Q,K instead of 1,11,12,13.)
The card set class should be able to
- create a card set in order (all the
cards will initially be separated by suit and ordered by value)
- shuffle a card set (thoroughly!)
- display a card set
- remove and return an existing card
from a card set
- accept and add in a new card to a
card set
Be sure both of your classes have zero-argument constructors!
In the case of a cardset this would be
a set of 0 cards; in the case of a single card, make up some default
(such as the Ace of Spades).
The numbers 3,4,5, and 6, when treated as char's will print out as pictures
of the four suits.
All of your member data must be private. Your member functions
should all be public.
The code in main will be very brief (about 15 lines). The
entire program can be done in 120 lines.
Here is an executable solution.