Question
Step 1: Implement the Card class from Assignment 2 In another assignment, you must implement several C++ classes and use them to write a Go
Step 1: Implement the Card class from Assignment 2
In another assignment, you must implement several C++ classes and use them to write a Go Fish game. In this lab, well implement and test a few of those classes. The first one youll implement is the Card class, which represents a single playing card:
Youll need to implement the needed constructors, destructors, accessor functions, and mutator methods. To do this, think carefully about what operations (if any) youll need to perform on an individual card and what information youll need to be able to get from the card. Put the definition for this class in card.hpp and the implementation in card.cpp.
Step 2: Implement the Deck class from Assignment 2
Once you have a class to represent a single card, you can implement your class to represent a whole deck of 52 cards:
When writing the methods for this class, make sure you write a method to print the hand out to std::cout. Put the definition for this class in hand.hpp and the implementation in hand.cpp.
Step 3: Write a small application to deal a hand of cards
In order to test your classes, write a small program that uses them to do the following things:
Initializes a new deck of 52 cards.
Shuffles that deck.
Deals a hand of 7 cards.
Prints the contents of that hand to the console.
Put this program in deal_hand.cpp. Also, add a Makefile to compile your program.
class Card f private: int rank: 1/ Should be in the range 0-12 int suit; /I Should be in the range 0-3. public // constructors, destructor, accessors, and mutators lStep 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