The program will be divided into 3 files: main.cpp, player.h, and player.cpp
player.h: This header file will contain the following organization sections (Separate all sections by use of comments // or /* */)
1) Library inclusions: Instead of putting all of the libraries and “using namespace std;” required in main, we will include them here and include “player.h” in main.cpp.
2) Constants: Create constants (symbolic or other) for the following:
Cards per standard deck of cards = 52
Face variations per deck of cards = 13
Suit variations per deck of cards = 4
Maximum Number of cards in the player’s hand = 10
3) Card structure: Create a structure of card that (at minimum) contains the elements:
string face;
string suit;
4) Functions to handle the functionality of the deck of cards:
card getTopCard(card *deck, int size)
void shuffle(card *deck, int size)
5) The class Player including members and member function prototypes:
Members – the members of this class should include the first and last name (separate) of the player, the amount of money the player has to use in a bet, the hand of cards, as well as the score. All members should be contained in the private section of the class.
The hand of cards should be made as an array of structure card type set to the Maximum Number of cards in the player’s hand constant.
Member Functions – the member functions in this class should include Constructors, Accessors, and Mutators in order to make this class functional. Function prototypes should include (at a minimum) all of the prototypes listed below. All member functions should be contained in the public section of the class.
void addCard(card)
void calculateScore();
void displayInfo();
double getCash()
string getFirstName()
string getLastName()
int getScore();
Player()
Player(string, string, int, double)
void setCash(double)
void setFirstName(string)
void setLastName(string)
void showHand()
In the class, organize the member functions by Constructors, Accessors, and Mutators by use of comments.
player.cpp: This is where all of the functions (prototyped in player.h) are implemented. Separate the structure functions and the Player functions by use of comments ( // or /* */) See Appendix for function descriptions.
main.