Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

Draw the customer into conversation establish contact.

Answered: 1 week ago

Question

=+employee to take on the international assignment?

Answered: 1 week ago