Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(C++ Program in Microsoft Visual Studio) Hello, I have a program about a card game where I have to use three different files. I haven't
(C++ Program in Microsoft Visual Studio)
Hello, I have a program about a card game where I have to use three different files. I haven't received help on the last 6 questions I've posted, so I'm just being hopeful you guys will help me with this! I have taken screenshots of the instructions for the program, and I have written in red the page number, so there is no confusion. Thank you!!
void displayHand(int x, int y); int computeScore(); void deal); #endif Split the program into 3 files - CardPlayer.h, CardPlayer.cpp, and main.cpp Table 1 Card No Card Value h2.bmp,s2.bmp,d2.bmp,c2.bmp h3.bmp,s3.bmp,d3.bmp,c3.bmp h4.bmp,s4.bmp.d4.bmp,c4.bmp h5.bmp,s5.bmp,d5.bmp,c5.bmp h6.bmp s6.bmp.d6.bmp.c6.bmp h7.bmp,s7.bmp,d7.bmp,c7.bmp h8.bmp.s8.bmp.d8.bmp.e8.bmp h9.bmp,s9.bmp.d9.bmp,c9.bmp h10.bmp,s10.bmp,d10 bmp,c10.bmp hll.bmp,s11.bmp.d11.bmp.cll.bmp h12.bmp,s12.bmp,d12.bmp,c12.bmp h13.bmp,s13.bmp.d13.bmp.c13.bmp h14.bmp,s14.bmp.d14.bmp,c14.bmp 10 10 10 Overview (Save this file as labin.cpp) Write a C++ program utilizing the CardPlayer class as shown below: (What does #ifnder, #define, and #endif mean? 12 13 14 10 The program will utilize a deck of cards using the following card numbers, points and file names as shown in Table I: #1fndef CARDP LAYERH #define CARDPLAYER H The deck is divided into halves -the playerl (or dealer) will receive the red suits (diamonds and hearts) while the dealer (or playerl) will receive the black suits (clubs and spaids) - class CardPlayer For this lab only the diamonds and clubs suits will be used private: char color; int nocards; int* hand; The user will be prompted for which suit color is to be assigned to the playerl (i.e., the user) as shown below: CWin nter suit colors for player CF for red suits. b for black suits>: public: CardPlayer); CardPlayer); void setNoCards (int noCards); int getNoCards); void setcolor(char color); This prompt is performed in main only once per entire program (i.e, not prompted when program repeats), and allows the user to enter a single character- either 'r for the red suits or b' or the black suits This data entered by the user is used by the selColor method of the CardPlayer class for setting the suit category. Ifthe user does not enter r' or 'b', display an appropriate error message and re-prompt the user in main again. Program only has to run once for this lab Player 1 Dealer Next, the user will be prompted for the number of cards to deal as shown below: Private Datafield Description Utilize the following private datafields when nter suit colors for player r for red suits. b for black suits F inter # of cards to deal to each player -5 but > nocards //Set the nuCards (will need to dynamically allocate the hand inside of this method) Example template for main.cpp #includeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started