Question: Please provide full answer with comments better to understand it is just beginning of c++ so please don't use advances teqniques. I will add screenshots

Please provide full answer with comments better to understand it is just beginning of c++ so please don't use advances teqniques. I will add screenshots off main.cpp,card.h, deck.h, hand.h, shuffle.h, and deck.cpp

Please provide full answer with comments better to understand it is just

beginning of c++ so please don't use advances teqniques. I will addI will add screenshots of files First is main.cpp , second card.h, third deck.h, fourth hand.h , fifth shuffle.h, sixth deck .cpp if you help me with this will be greatly thankful

main.cpp

#include #include "card.h" #include "deck.h" #include "hand.h" #include

using namespace std;

int main() { card c1(13,'D'); cout

hand h1; h1.c1 = card(13,'D'); h1.c2 = card(11, 'D');

hand h2; h2.c1 = card(13, 'S'); h2.c2 = card(11, 'S');

cout h2)

card.h

#pragma once #include using namespace std;

class card { int num; char suit; //there are 4 suits: C D H S public: void setNum(int n); void setSuit(char s); int getNum(); char getSuit(); string read(); card(); card(int n, char s); };

deck.h

#pragma once #include "card.h"

class deck { private: card stack[52]; int deal_count; public: deck(); void print_deck(); void shuffle(); card deal(); int stack_size(); void gather_and_shuffle(); };

hand.h

#pragma once #include "card.h"

class hand { public: card c1, c2; bool operator(hand rhs); bool operator=(hand rhs); bool operator==(hand rhs); };

shuffle.h

#include #define SEED_MACRO chrono::system_clock::now().time_since_epoch().count()

deck.cpp

#include #include #include #include #include "deck.h" #include "shuffle.h" using namespace std;

//Do not change this function void deck::shuffle() { assert(deal_count == 0); std::default_random_engine eng(SEED_MACRO); std::shuffle(stack, stack + 52, eng); }

void deck::print_deck() { for (int i = 0; i

Problem 2: (Deck) Write the member function implementations for the class deck which simulates the standard deck of 52 playing card into the file deck.cpp. The private field card stack [52]; represents the 52 cards of a deck The private field int deal count represents how many cards have been dealt from the deck. The public member function void print-deck prints out the deck in order. The implementation is provided. The default constructor

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!