Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ programming C++ programming C++ programming Homework 4-Deck of Cards Write a program that creates a deck of cards, shuffles it, deals four hands, and

C++ programming

C++ programming

C++ programming

image text in transcribed

Homework 4-Deck of Cards 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 nitialize -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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2005 For Windows Mobile Web Office And Database Applications Comprehensive

Authors: Gary B. Shelly, Thomas J. Cashman, Corinne Hoisington

1st Edition

0619254823, 978-0619254827

More Books

Students also viewed these Databases questions

Question

10:16 AM Sun Jan 29 Answered: 1 week ago

Answered: 1 week ago

Question

LO2 Distinguish among three types of performance information.

Answered: 1 week ago