The program will be divided into 3 files maincpp playerh and
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.cpp: This is the test bench for your player.h and player.cpp files. In this file, the program will: Ask for the number of decks you want to shuffle. Ask for the number to seed for srand() Asks for the number of the cards to deal to the hand – checks to see if this value is between 1 and the maximum number of cards in the player’s hand. If the value is not between these two values, asks again until a proper number is given. Seeds srand() with the value given. Creates an array of cards (structure type card) of a size that equals to the number of decks times the number of cards per deck (constant in player.h) Shuffles the deck of cards Creates an object of player class and sets the first name and last name to your name, the starting score to 300, and the starting money to 1000. Displays the user info Adds cards to the user in a ‘for’ loop. Also shows the hand and calculated score for each new card added. The loop continues until the number of cards specified by the user is met. Sample Output: The sample output does not have to be identical to the output here, BUT the output must be organized and readable. Also, the suit can be displayed in letter format (H, S, D, C) or (,, , )
Each card you draw is te score. For examle if I am drawing 3 cards my first one is 7 the score is 7, my seconde is 10 the score is 7+10 = 17 te last one is Ace score becomes 7+10+1= 18
Solution
import javafx.scene.image.*; public class Card implements Comparable
