Question: I need help, to turning in the next code in : Card.h, Card.cpp, DeckOfCards.h, DeckOfCards.cpp, PokerHand.h, PokerHand.cpp and pokerdriver.cpp that has your main. can you

I need help, to turning in the next code in : Card.h, Card.cpp, DeckOfCards.h, DeckOfCards.cpp, PokerHand.h, PokerHand.cpp and pokerdriver.cpp that has your main. can you guys can help me to separate each part .

I need help, to turning in the next code in : Card.h,Card.cpp, DeckOfCards.h, DeckOfCards.cpp, PokerHand.h, PokerHand.cpp and pokerdriver.cpp that has your main. canyou guys can help me to separate each part . code: //includethe required header files #include #include #include //use the namespace standard usingnamespace std; //define a class named card class Card { //access specifier

private: //private data types int face, suit; //static array faces static stringfaces[14]; //static array suits static string suits[4]; //access specifier public: //constructor Card(intface, int suit); //to string operation to represent faces and strings string

code:

//include the required header files

#include

#include

#include

//use the namespace standard

using namespace std;

//define a class named card

class Card

{

//access specifier

private:

//private data types

int face, suit;

//static array faces

static string faces[14];

//static array suits

static string suits[4];

//access specifier

public:

//constructor

Card(int face, int suit);

//to string operation to represent faces and strings

string toString();

};

//define the values for faces[]

string Card::faces[] = {"", "Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King"};

//define the values for suits[]

string Card::suits[] = {"Hearts", "Spdaes", "Clubs", "Diamonds"};

//constructor class

Card::Card(int face, int suit)

{

//use this operator

this->face = face;

//use this operator

this->suit = suit;

}

//to return string in the form of face of suit

string Card::toString()

{

//set the delimiter

string mid_wrd = " of ";

//return the string value

return faces[face] + mid_wrd + suits[suit];

}

//define a class named deckofcards

class DeckOfCards

{

//access specifier

private:

//declare a vector

vector cards;

//variable to represent the next card to deal

int current_Card;

//access specifier

public:

//default constructor

DeckOfCards();

//declare the function shuffle

void function_shufle();

//declare the function dealCard()

Card dealCard();

//declare the function moreCards()

bool moreCards();

};

//define the function

DeckOfCards::DeckOfCards()

{

//declare the varibale

current_Card = 0;

//loop through 52 cards

for(int i = 0; i

{

//initialises the card in the desk

cards.push_back(Card((i % 13) + 1, i / 13));

}

}

//function definition

void DeckOfCards::function_shufle()

{

//declare the variable

int r_i;

//loop through 52 cards

for(int i = 0; i

{

//select the card randomnly

r_i = rand() % 52;

Card temp = cards[i];

cards[i] = cards[r_i];

cards[r_i] = temp;

}

}

//function definition

Card DeckOfCards::dealCard()

{

//return the next card object from deck

return cards[current_Card++];

}

//function definition

bool DeckOfCards::moreCards()

{

//return whether there are more cards to deal with

return current_Card

}

//main function()

int main()

{

//create an object

DeckOfCards obj;

//call the function

obj.function_shufle();

//print the cards

while(obj.moreCards()){

cout

}

return 0;

}

//include the required header files #include #include #include //use the namespace standard using namespace std; //define a class named card class Card //access specifier private: //private data types int face, suit; //static array faces static string faces [14]; //static array suits static string suits [4]; //access specifier public: //constructor Card (int face, int suit); //to string operation to represent faces and strings string toString )

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!