Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 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 2 Heart Queen Heart 4 Diamond Jack Spade Jack Spade 8 Spade 4 Heart Ace Heart King Heart 7 Diamond Ace Diamond King Diamond Queen Club 10 Spade King Spade Queen Spade 10 Spade 9 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started