I need help making these classes for a C++ project. I\'m using Visual Studios cu
ID: 3555268 • Letter: I
Question
I need help making these classes for a C++ project. I'm using Visual Studios currently. If you have any questions, just let me know.
A class card that represents a playing card.
? Data members should include at least:
? a rank (ace, 2, 3, etc.)
? a suit (hearts, spades, clubs, diamonds)
? Methods (member functions) should include at least:
? int get_value() which gets the value of the card
A class hand that represents a Baccarat hand. It is a collection of cards.
? Data members should include at least:
? A vector of pointers to card objects
? void add(card* c) which adds a card to the hand by adding a pointer to a card
object to the vector of cards representing the hand
? void clear() which removes all cards from the hand and cleans up all deleted
objects
? int get_total() which returns the total value of the hand
A class deck that represents the deck of cards. This class should be derived from the class
hand (because it is just a collection of card objects) but it has some extra functionality that a
hand does not have, like shuffling and dealing.
? Data members should include all those inherited from hand and any others you wish to
include.
? Member functions should include at least:
? void build_deck() that creates a standard deck of 52 card objects
? void shuffle() that shuffles the cards in the deck
? void deal (hand &h) that deals one card to a hand
A class generic_player that represents those elements that all players have in common.
Because a player can be viewed as a Baccarat hand with a name, this class should be derived
from the class hand.
? Data members should include any inherited data members plus
? A string representing the player
Explanation / Answer
This is my driver that should be running the class. Here is my program file:
And here is my header file:
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.