I have to simulate a card player getting a a pile of 52 cards (a full deck).
I need to print the cards so that they are printed on 4 lines (1 line for each suit) 13 cards to a line. (I.E. AC (Ace of clubs) KC QC etc.)
The first two files where provided in class:
Code:
CODE
/** @file Card.h
*
*/
class Card
{
private:
char rank;
char suit;
public:
void printMe();
void setRank(char);
void setSuit(char);
char getRank();
char getSuit();
int getBridgeValue();
};
*
*/
class Card
{
private:
char rank;
char suit;
public:
void printMe();
void setRank(char);
void setSuit(char);
char getRank();
char getSuit();
int getBridgeValue();
};
Code:
CODE
/** @file Card.cpp
*
*/
#include "Card.h"
#include <iostream>
using namespace std;
void Card::printMe()
{
cout << getRank() << getSuit();
}
void Card::setRank(char whatrank)
{
rank = whatrank;
}
void Card::setSuit(char whatsuit)
{
suit = whatsuit;
}
char Card::getRank()
{
return rank;
}
char Card::getSuit()
{
return suit;
}
*
*/
#include "Card.h"
#include <iostream>
using namespace std;
void Card::printMe()
{
cout << getRank() << getSuit();
}
void Card::setRank(char whatrank)
{
rank = whatrank;
}
void Card::setSuit(char whatsuit)
{
suit = whatsuit;
}
char Card::getRank()
{
return rank;
}
char Card::getSuit()
{
return suit;
}
We must code ourselves at least a Pile.h, Pile.cpp Hand.h, Hand.cpp, pr1.cpp, and build.sh
I have attempted to code the some of the Pile.h and Pile.cpp ising the required Array-Based Implentation of the ADT List.
Here is my Pile.h file
Code:
CODE
/** @ Pile.h
*
*/
//#include "Card.h"
const int MAX_LIST = 52;
typedef Card ListItemtype; // List item data type
//ListItemType items[MAX_LIST]; //Array of list items */
Card items[MAX_LIST]; //array of cards
int size; // LOGICAL length of the list
class Pile
{
private:
Card items[MAX_LIST];
public:
Pile();
// void createDeck();
/* void orderCards();
void dealCard();
void randomize();
void printMe();
*/
};
*
*/
//#include "Card.h"
const int MAX_LIST = 52;
typedef Card ListItemtype; // List item data type
//ListItemType items[MAX_LIST]; //Array of list items */
Card items[MAX_LIST]; //array of cards
int size; // LOGICAL length of the list
class Pile
{
private:
Card items[MAX_LIST];
public:
Pile();
// void createDeck();
/* void orderCards();
void dealCard();
void randomize();
void printMe();
*/
};
I keep getting syntax errors on the typedef statement and the "Card items[MAX_LIST]; "
Please help?
P.S. If I seem inept I haven't coded in C++ in a year so while I know all the very basic things I've forgotten a lot too.


