Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please provide full answer with comments me to better understand this is beginning of c++ so don't use advanced techniques thank you First screenshot is

Please provide full answer with comments me to better understand this is beginning of c++ so don't use advanced techniques thank you

image text in transcribed

image text in transcribed First screenshot is main.cpp second card.h third deck.h fourth hand.h fifth shuffle.h and 6th main.cpp

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribedIf you help 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 Download the starter code main.cpp, card.h, deck.h, hand.h, shuffle.h, and deck.cpp. Do not modify the header files. We have provided main.cpp to give you an idea of how we intend to use the functions. Put the implementations into the files card.cpp, deck.cpp, and hand.cpp. Other cpp files must not contain a main function. You may not use any libraries aside from iostream, string, and cassert. You may not use global variables. We may take off up to 20% of the total marks for poor style; make sure to name your variables reasonably, indent properly, and comment sufficiently. Submit card.cpp, deck.cpp, and hand.cpp

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

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions