Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lets play cards. Using the class provided, create another class called DeckOfCards. This class will maintain a deck of cards using a Stack of Card

Lets play cards. Using the class provided, create another class called DeckOfCards. This class will maintain a deck of cards using a Stack of Card objects. There should be no duplicate cards in the deck. The DeckOfCards class should provide methods to:

  • Populate the deck (constructor)
  • Shuffle the deck of cards (may need more stacks or other structures in the method).
  • A method to deal a card.
  • Method provides the number of cards remaining in the deck.

Another class will be needed called PlayerHand. This class will maintain a players hand in a game of Black Jack. Limit the hand to 5 cards. Provide

  • Method to add cards to the hand
  • Method to get cards in the hand.
  • Use a Queue to store the cards in.

The driver of the program will control the game between just two players. Dealing (DeckOfCards) the cards to the players (PlayerHand). It will also determine who the winner is. Player should be able to take hits and indicate when they are done. Once both players are done main will determine the winner.

Can use the STL versions of the Stack and Queue.

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

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

=+1.3(b), show that a trifling set is nowhere dense [A15].

Answered: 1 week ago

Question

what is a peer Group? Importance?

Answered: 1 week ago