Question: C++ Write a program that creates a deck of cards, shuffles it, deals four hands, and displays each hand on the console. 1) Write a

C++

Write a program that creates a deck of cards, shuffles it, deals four hands, and displays each hand on the console. 1) Write a class Card with these member attributes: Suit (use enumerated data type for spades, hearts, diamonds, clubs) Number (1 through 13 jack is 11, queen is 12, king is 13) Description (string which displays name of card, such as Ace of Hearts) Card has an overloaded < operator, which returns true or false based on these rules: Regardless of card number, spades > hearts > diamonds > clubs Within a suit, the numeric value determines >, except for aces (value 1) which are > all numeric values Create additional member functions as needed.

2) Write a class Deck with just one member attribute, and array of 52 cards. Deck has these member functions: Initialize initializes values for deck of cards Shuffle shuffles deck Deal deals cards to four hands Sort sorts each hand into order Display displays four hands on console as follows: HAND 1 HAND 2 HAND 3 HAND 4 ---------- ---------- ----------- ---------- Spade Ace Spade Jack Heart 7 Spade King Spade 2 Spade 8 Diamond Ace Spade Queen Heart Queen Spade 4 Diamond King Spade 10 Heart 4 Heart Ace Diamond Queen Spade 9 Diamond Jack Heart King Club 10 Spade 7 . . . . . . . . . . . . Do not use library functions for sort or shuffle - you must write your own. Create additional member functions as needed.

3) Write a main program which asks if user wants to shuffle deck, deal cards, or end. After each deal, it should display cards.

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!