I am trying to compile a poker program in c++ and it still doesn't work: main.cpp: #include #include #include #include #include #include "card.h" #include "deck.h" #include "hand.h" using...


I am trying to compile a poker program in c++ and it still doesn't work:


main.cpp:


#include
#include
#include
#include
#include


#include "card.h"
#include "deck.h"
#include "hand.h"


using namespace std;


/************************************************************
* FunctionName *
* Function description *
* *
* *
************************************************************/
int main()
{
string repeat = "Y";
Deck myDeck;
Hand myHand;
string exchangeCards;


while (repeat == "Y" || repeat == "y")
{
cout <>


myHand.newHand(myDeck);
myHand.print();
cout <>


cout < "would="" you="" like="" to="" exchange="" any="" cards?="" [y="" n]:="">
getline(cin, exchangeCards);


while (exchangeCards != "Y" && exchangeCards != "y" && exchangeCards != "X" && exchangeCards != "n")
{
cout < "please="" enter="" y="" or="" n="" only:="">
getline(cin, exchangeCards);


}


if(exchangeCards == "Y" || exchangeCards == "y")
{
myHand.exchangeCards(myDeck);
}
cout <>


myHand.print();


cout <>


myDeck.reset(); // Resets the deck for a new game


cout < "play="" again?="" [y="" n]:="">
getline(cin, repeat);
while (repeat != "Y" && repeat != "y" && repeat != "N" && repeat != "n")
{
cout < "please="" enter="" y="" or="" n="" only:="">
getline(cin, repeat);


}


}


return 0;
}



card.h:


#ifndef CARD_H
#define CARD_H


#include
#include
using namespace std;


// Sources: https://en.wikipedia.org/wiki/Standard_52-card_deck
// https://en.wikipedia.org/wiki/Pip_(counting)


const string pips[] = {"Ace", "Two", "Three", "Four", "Five",
"Six", "Seven", "Eight", "Nine", "Ten",
"Jack", "Queen", "King"};
const string suits[] = {"Hearts", "Spades", "Clubs", "Diamonds"};




class Card
{
public:
// Get card value
int get();


// Set card value
void set(int value);


string getPip();


string getSuit();


// Print card value
void print();


private:
int m_cardValue;
};


#endif


Deck.h:



#ifndef DECK_H
#define DECK_H


#include
#include // srand(), rand()
#include // time()
#include "card.h" // Include card header file here
using namespace std;


class Deck
{
public:
// class Constructor
Deck();


// Reset deck to new state (completely undealt)
void resetDeck();


// Print all cards in the undealt deck
void printUndealtDeck();


// Print all cards in the dealt deck
void printDealtDeck();


// Get size of the undealt deck
const int getSizeUndealtDeck();


// Get size of the dealt deck
const int getSizeDealtDeck();


// Deal a single card
Card dealCard(); // Is the dealCard() here an accessor or mutator function???


private:
vector m_undealtDeck; // Undealt cards
vector m_dealtDeck; // Dealt cards
};


#endif



hand.h



#ifndef DECK_H
#define DECK_H


#include
#include // srand(), rand()
#include // time()
#include "card.h" // Include card header file here
using namespace std;


class Deck
{
public:
// class Constructor
Deck();


// Reset deck to new state (completely undealt)
void resetDeck();


// Print all cards in the undealt deck
void printUndealtDeck();


// Print all cards in the dealt deck
void printDealtDeck();


// Get size of the undealt deck
const int getSizeUndealtDeck();


// Get size of the dealt deck
const int getSizeDealtDeck();


// Deal a single card
Card dealCard(); // Is the dealCard() here an accessor or mutator function???


private:
vector m_undealtDeck; // Undealt cards
vector m_dealtDeck; // Dealt cards
};


#endif




This is the error I am getting.


H *main.cpp - Code:Blocks 20.03<br>File Edit View Search Project Build Debug Fortran wxSmith Tools Tools+ Plugins DoxyBlocks Settings Help<br>> E G: 4: A G: II E<br>E C:<br>团<br>| <global><br>v main0 : int<br>/** *<<br>+ + 2 Aa *<br>Q Q S C<br>Management<br>Start here x *main.cpp x card.h X deck.h x hand.h Xx<br>•<br>Projects Files<br>FSymbols<br>|| exchangeCards == x Build log X Build messages X CppCheck/Vera++ X CppCheck/Vera++ messages X Cscope X Debuggl File Line Message === Build file: "no target" in "no project" (compiler: unknown) === C:\Users\Mica... In function 'int main ()': C:\Users\Mica... 62 error: 'resetDeck' was not declared in this scope === Build failed: 1 error (s), 0 warning (s) (0 minute (s), 2 second (s)) %3%D3D3D C:\Users\Micai\Downloads\Assignment2\main.cpp C/C++ Windows (CR+LF) WINDOWS-1252 Line 55, Col 10, Pos 1444 Insert Modified Read/Write default "/>
Extracted text: H *main.cpp - Code:Blocks 20.03 File Edit View Search Project Build Debug Fortran wxSmith Tools Tools+ Plugins DoxyBlocks Settings Help > E G: 4: A G: II E E C: 团 | v main0 : int /** *< +="" +="" 2="" aa="" *="" q="" q="" s="" c="" management="" start="" here="" x="" *main.cpp="" x="" card.h="" x="" deck.h="" x="" hand.h="" xx="" •="" projects="" files="" fsymbols="" ||="" exchangecards="=" "y")="" 52="" if(exchangecards="=" "y"="" workspace="" 53="" 54="" myhand.exchangecards="" (mydeck)="" ;="" 55="" 56="" cout="">< endl;="" 57="" 58="" myhand.print="" ();="" 59="" 60="" cout="">< endl;="" 61="" 62="" d="" mydeck.reset="" ();="" resets="" the="" deck="" for="" a="" new="" game="" 63="" cout="">< "play="" again?="" [y="" n]:="" ";="" getline="" (cin,="" repeat);="" while="" (repeat="" !="Y" &&="" repeat="" !="y" &&="" repeat="" !="N" &&="" repeat="" !="n" )="" 64="" 65="" 66="" 67="" {="" 68="" cout="">< "please="" enter="" y="" or="" n="" only:="" ";="" 69="" getline="" (cin,="" repeat);="" 70="" logs="" &="" others="" a="" code:blocks="" x="" search="" results="" x="" cccc="">x Build log X Build messages X CppCheck/Vera++ X CppCheck/Vera++ messages X Cscope X Debuggl File Line Message === Build file: "no target" in "no project" (compiler: unknown) === C:\Users\Mica... In function 'int main ()': C:\Users\Mica... 62 error: 'resetDeck' was not declared in this scope === Build failed: 1 error (s), 0 warning (s) (0 minute (s), 2 second (s)) %3%D3D3D C:\Users\Micai\Downloads\Assignment2\main.cpp C/C++ Windows (CR+LF) WINDOWS-1252 Line 55, Col 10, Pos 1444 Insert Modified Read/Write default
Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here