Question: ADJUST previous program1. You will create a class Deck that consists of the following: a. The vector of 116 cards from last weeks program. b.
ADJUST previous program1. You will create a class Deck that consists of the following:
a. The vector of 116 cards from last weeks program.
b. a method to deal a card from the deck
2. Create overloaded operators:
a. bool operator == that overloads the == operator to check if two cards are equal.
b. bool operator
3. Create a Hand for each player that consists of nine cards from last weeks program.
Program main that will do the following:
Create the deck.
Shuffle the deck.
Print the deck.
Prompt the user for the number of players, and accept a value from 2 to 7 (reject any other values).
Deal hands of nine cards to each player.
Print the hands.
Evaluate each hand. Determine if any cards are equal to each other (i.e. pairs) and print the result.
Adjust program below with above instructions
cards.h
#include
cards.cpp
#include
string getTextForSuit(suits suit) { switch (suit) { case Clubs: return "Clubs";
case Diamonds: return "Diamonds";
case Hearts: return "Hearts";
case Spades: return "Spades";
case Stars: return "Stars";
default: return "Not recognized.."; } }
string getTextForFace(faces face) { switch (face) { case Three: return "Three"; case Four: return "Four"; case Five: return "Five"; case Six: return "Six"; case Seven: return "Seven"; case Eight: return "Eight"; case Nine: return "Nine"; case Ten: return "Ten"; case Jack: return "Jack"; case Queen: return "Queen"; case King: return "King"; default: return "Not recognized.."; } }
Card::Card(faces face, suits suit) { this->face = face; this->suit = suit; }
string Card::toString() { if (this->face == Joker) return "Joker"; return getTextForFace(face) + " of " + getTextForSuit(suit); }
cardsimplementation.cpp
#include
void shuffleDeck(vector
}
}
int main() { vector
for (int i = 0; i
for (int i = 0; i
shuffleDeck(&deck); cout
for (int i = 0; i


CAUsers charlie all stud 2015ProjectsAcardsimplementationVDebuglcardsimplementation.exe Nincspade KingDiamond ghtst Queenspad Eight Diamonds Queenspad espada ghtst Kingspade Four Spada rspada ghtspad kspada 2-13 PM 2/2s 2017 R190
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
