Question
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
First screenshot is main.cpp second card.h third deck.h fourth hand.h fifth shuffle.h and 6th main.cpp
If you help with this will be greatly thankful
main.cpp
#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
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
deck.cpp
#include
//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
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