Question: c++ programming Instruction: C++ programming 1, Use the code beneth to do the home work 6 on the picture. 2, Read the question carefully. homework
c++ programming
Instruction:
C++ programming
1, Use the code beneth to do the home work 6 on the picture.
2, Read the question carefully.

homework 5(same as homework 4).

Homework 5 answer.
#include #include #include #include #include #define SIZE 52 using namespace std; enum Suit //creating a data type that helps to store the value of suits { Unknown=0, Clubs=1, Diamonds=2, Hearts=3, Spades=4 }; class Card // creating a card class that hold the decription, suit,and decription of the card { Suit suit; // holds 4 types of suits int number; string description;//holds the name of the card public: Card() //creating a constructor { suit=Unknown; number=0; description.assign(""); } Suit getSuit() // get member function for suit that return suit type { return suit; } void setSuit(Suit s)// set member function for suit that assigns suit type { suit=s; } int getNumber() //get number member function type for getting the numbers on the card { return number; } void setNumber(int Number) //set member function to set the numbers on the card { number=Number; } string getDescription() { return description; } void setDescription(string Description) { description.assign(Description); } bool operator const Card& c) { if(suit return true; } else if(suit>c.suit) return false; else { if(number == 1) return true; else if(c.number==1) return false; else return (numbertrue:false; } } }; class Deck { Card deck[SIZE]; public: // building member functions to what will be performed using the 52 cards. void initialize(); void shuffle(); void deal(); void sort(Card hands[13][4]); void display(Card hands[13][4]); }; void Deck::initialize() //intializing card types by number of accurance in 4*13 deck { string des; char n[10]; int flag; for(int i=1;iif(i==1 || i==14 || i==27 || i==40) { des.assign("Ace"); flag=1; } else if(i==11 || i==24 || i==37 || i==50) { des.assign("Jack"); flag=1; } else if(i==12 || i==25 || i==38 || i==51) { des.assign("Queen"); flag=1; } else if(i==13 || i==26 || i==39 || i==52) { des.assign("King"); flag=1; } if(iSpades); deck[i-1].setNumber(i); if(flag==0) { itoa(deck[i-1].getNumber(),n,10); des.assign((string)n); } des.append(" of Spades"); deck[i-1].setDescription(des); } else if(i>13 && iHearts); deck[i-1].setNumber(i-13); if(flag==0) { itoa(deck[i-1].getNumber(),n,10); des.assign((string)n); } des.append(" of Hearts"); deck[i-1].setDescription(des); } else if(i>26 && iDiamonds); deck[i-1].setNumber(i-26); if(flag==0) { itoa(deck[i-1].getNumber(),n,10); des.assign((string)n); } des.append(" of Diamonds"); deck[i-1].setDescription(des); } else { deck[i-1].setSuit(Clubs); deck[i-1].setNumber(i-39); if(flag==0) { itoa(deck[i-1].getNumber(),n,10); des.assign((string)n); } des.append(" of Clubs"); deck[i-1].setDescription(des); } } } void Deck::display(Card hands[13][4]) //building the hand for 4 people and handing them 13 cards each { Suit suit; int number; cout Homework 6-Game of Hearts Before writing any code, review the rules of the game, page 2, and play a few games at playhearts-online.com Write a program that plays the card game of Hearts. Your program should build on your code for homework 5, including your overloaded Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
