Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C ++ Programming - Player and Dealer Classes Player and Dealer Classes For this exercise, you are to create two classes: Player and Dealer You

C ++ Programming - Player and Dealer Classes

image text in transcribed

image text in transcribedimage text in transcribedimage text in transcribed

image text in transcribedimage text in transcribedimage text in transcribed

Player and Dealer Classes For this exercise, you are to create two classes: Player and Dealer You should create and test Player first. Player is again an example of aggregation and includes an instance of BlackJackHand, in the same way that CreditCard included a Person. You will call the BJH methods to implement most of the player methods. For example, if you named your BJH instance myHand, the player function takeCard is simply: bool takeCard (PlayingCard* pc) return myHand.addard (pc):h Once you have created and tested Player, using the provided PlayerTest driver, you can create Dealer. Dealer is an example in inheritance, in that it is a child of Player. It differs by adding an instance of PlayingCardDeck and calling that deck to implement its different methods. It also overwrites the showHand method as described below. Once you have completed Dealer, you can test it with the provided test driver. After both Player and Dealer have been completed and tested, you can play a simple game of BlackJack using the provided game.cpp code. This game only allows for one player with a single hand and does not allow for splits or doubling. If you wanted to add those features, you can modify the game code. Player Design As with PlayingCardDeck, you will need to create a new project and add the existing PlayingCard.h and PlayingCard.cpp files to it along with the provided BlackJackHand.h and BlackJackHand.cpp files. You then will create a new class as part of this project and name it Player. This will add two more files to the project, Player.h and Player.cpp. Player.h will need to include BlackJackHand.h so that you can use BJH objects in your player class. Player needs to include an instance of BJH. You will use this as described above to implement the following methods

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions

Question

Does your strategic intent lay out the priorities?

Answered: 1 week ago

Question

internationalization of business?

Answered: 1 week ago