SlideShare ist ein Scribd-Unternehmen logo
1 von 4
Rules
1) The object of the game is to beat the dealer's score with a
total equal to or less than
twenty one.
2) The game uses a standard deck (or multiple decks of cards).
There are no jokers in the
deck(s). Face cards count as 10 points each, Aces may count as
either 1 or 11, whilst all
other cards have their face value.
3) If the game is being played using wagers, then the player
must place a wager before the
hand is dealt.
4) The dealer then deals two cards to each player. These cards
are typically dealt face up.
5) The dealer then deals two cards to himself or herself. One of
the dealer's cards is dealt
face up, whilst the other card is dealt face down.
6) Play then progresses around the table. A player is allowed
several different options with
his or her hand. However, we will only implement some of these
for our game.
a. The player can "hit". That is, the player can request an
additional card to add to
his or her hand. The player can then select another option.
However, if the
additional card forces the player over 21, then the player loses
and must surrender
his or her cards and wager. This is called a bust.
b. The player can "stand". That is, the player can keep the value
of cards that he or
she has. Play progresses to the next player.
c. The player can "double down". This is where a player doubles
his or her wager.
The player then receives an additional card, but cannot receive
any additional
cards. Play progresses to the next player.
7) After all the players have finished their turns. The dealer
turns over his or her hidden card
and adds up his or her score. If the score is 17 or more, the
dealer is finished. If the
dealer's score is 16 or less, then the dealer must "hit" until his
or her score is greater than
16 or he or she busts.
8) After the dealer has completed his or her turn, all the
remaining hands are compared
against the dealer's score. If a player has a higher score than the
dealer or the dealer
"busted", then the player wins an amount equal to his or her
wager. If the player has a
score less than the dealer, then he or she loses his wager. If the
player ties with the dealer,
the game is said to be a "push", and the original wager is
returned to the player.
9) BlackJack- This is when a player is dealt an ace and a ten
with his or her first two cards.
In this case, the player wins 1.5 times his or her wager unless
the dealer also has
blackjack in which case it is a push. If the dealer has blackjack,
then all players who don't
have a blackjack lose.There are also special insurance rules for
when the dealer shows an
ace, but we will worry about these later.
In this assignment, you will use classes and dynamic arrays to
create a blackjack simulator that
pits a single player against the dealer. The game should use the
rules given above and should
allow a player to keep track of the number of games they won.
It is not necessary to implement
betting, although you are free to do so if you would like.
Classes
In order to do this, your program will need to have three
separate classes.
Card Class
First, you will need a class for individual cards. This card class
should have member variables
for: suit (e.g. spades), value (e.g. jack), and points (e.g. 10).
You should obviously have
constructors, accessors, and mutators for this class. In addition,
you will need to overload the
following C++ operators for this class (==, =, <, >, and <<).
Deck Class
Next, you will need a deck. As a member variable, the deck will
need to contain all 52 cards. For
ease of implementation, you can put all 52 cards into a vector,
since you can shuffle them using
the following command:
std::random_shuffle( d.begin(), d.end() );
The deck should also have a constructor and a member function
that allows you to get a card
from it. Overloading the << operator is a good way to test the
functionality of the deck, but is not
necessary for the program.
Hand Class
Finally, the hand class will contain the cards in the player’s
hand. You must implement this class
using a member variable that is a dynamic array of cards for the
player’s hand. You will also
need to have member variables for the number of cards in the
hand as well as the score.
Obviously, you should write constructors, accessors, and
mutators for this class. Since this class
also uses dynamic memory, you will need to write a copy
constructor, destructor, and overloaded
equal (if implementing splits).
The other item that needs to be added to this class is an ability
to put an additional card into the
hand as player’s will often take additional cards during the
game of blackjack. Adding a card to
the hand requires reallocating dynamic memory and will be
similar to a copy constructor.
Implement your program using separate compilation for the
voter class and the main program.
As always, your code should have appropriate comments to
explain the program and the code. It
should be written in a consistent and readable form and should
compile without errors or
warnings.

Weitere ähnliche Inhalte

Ähnlich wie Rules1) The object of the game is to beat the dealers score wit.docx

Design Documentation
Design DocumentationDesign Documentation
Design Documentationvaiyash
 
project 6cards.pyimport randomclass Card( object ).docx
project 6cards.pyimport randomclass Card( object ).docxproject 6cards.pyimport randomclass Card( object ).docx
project 6cards.pyimport randomclass Card( object ).docxbriancrawford30935
 
Teaching a Computer To Play Blackjack.doc
Teaching a Computer To Play Blackjack.docTeaching a Computer To Play Blackjack.doc
Teaching a Computer To Play Blackjack.docbutest
 
Turtle strategyforbj
Turtle strategyforbjTurtle strategyforbj
Turtle strategyforbjhumbertobe
 
25 tips to build Tutorials on Board Game Arena
25 tips to build Tutorials on Board Game Arena25 tips to build Tutorials on Board Game Arena
25 tips to build Tutorials on Board Game ArenaBoard Game Arena
 
COMP 220 Entire Course NEW
COMP 220 Entire Course NEWCOMP 220 Entire Course NEW
COMP 220 Entire Course NEWshyamuopeight
 
Bolt Action Dutch Nationals rulepack 2019
Bolt Action Dutch Nationals rulepack 2019 Bolt Action Dutch Nationals rulepack 2019
Bolt Action Dutch Nationals rulepack 2019 Jordy Morsch
 
53252470-SCI-DAMATH-GAME.ppt
53252470-SCI-DAMATH-GAME.ppt53252470-SCI-DAMATH-GAME.ppt
53252470-SCI-DAMATH-GAME.ppthoneybal egipto
 
Yu-gi-oh Zexal Official Rulebook
Yu-gi-oh Zexal Official RulebookYu-gi-oh Zexal Official Rulebook
Yu-gi-oh Zexal Official RulebookHaris Setiawan
 
Blackjack dominance
Blackjack dominanceBlackjack dominance
Blackjack dominanceChidi Ibe
 

Ähnlich wie Rules1) The object of the game is to beat the dealers score wit.docx (16)

Design Documentation
Design DocumentationDesign Documentation
Design Documentation
 
Blackjack
BlackjackBlackjack
Blackjack
 
project 6cards.pyimport randomclass Card( object ).docx
project 6cards.pyimport randomclass Card( object ).docxproject 6cards.pyimport randomclass Card( object ).docx
project 6cards.pyimport randomclass Card( object ).docx
 
Baccarat pre game
Baccarat pre gameBaccarat pre game
Baccarat pre game
 
Roulette (559)
Roulette (559)Roulette (559)
Roulette (559)
 
Teaching a Computer To Play Blackjack.doc
Teaching a Computer To Play Blackjack.docTeaching a Computer To Play Blackjack.doc
Teaching a Computer To Play Blackjack.doc
 
Turtle strategyforbj
Turtle strategyforbjTurtle strategyforbj
Turtle strategyforbj
 
Baccarat
BaccaratBaccarat
Baccarat
 
25 tips to build Tutorials on Board Game Arena
25 tips to build Tutorials on Board Game Arena25 tips to build Tutorials on Board Game Arena
25 tips to build Tutorials on Board Game Arena
 
COMP 220 Entire Course NEW
COMP 220 Entire Course NEWCOMP 220 Entire Course NEW
COMP 220 Entire Course NEW
 
Bolt Action Dutch Nationals rulepack 2019
Bolt Action Dutch Nationals rulepack 2019 Bolt Action Dutch Nationals rulepack 2019
Bolt Action Dutch Nationals rulepack 2019
 
Blackjack Rules
Blackjack RulesBlackjack Rules
Blackjack Rules
 
Game Rules
Game RulesGame Rules
Game Rules
 
53252470-SCI-DAMATH-GAME.ppt
53252470-SCI-DAMATH-GAME.ppt53252470-SCI-DAMATH-GAME.ppt
53252470-SCI-DAMATH-GAME.ppt
 
Yu-gi-oh Zexal Official Rulebook
Yu-gi-oh Zexal Official RulebookYu-gi-oh Zexal Official Rulebook
Yu-gi-oh Zexal Official Rulebook
 
Blackjack dominance
Blackjack dominanceBlackjack dominance
Blackjack dominance
 

Mehr von joellemurphey

Eastern European countries appear to have become dependent on Ru.docx
Eastern European countries appear to have become dependent on Ru.docxEastern European countries appear to have become dependent on Ru.docx
Eastern European countries appear to have become dependent on Ru.docxjoellemurphey
 
EAS 209 Second Response Paper Topic Assignment Due .docx
EAS 209 Second Response Paper Topic Assignment Due .docxEAS 209 Second Response Paper Topic Assignment Due .docx
EAS 209 Second Response Paper Topic Assignment Due .docxjoellemurphey
 
Earth Science LabIn what order do materials settle in waterSo t.docx
Earth Science LabIn what order do materials settle in waterSo t.docxEarth Science LabIn what order do materials settle in waterSo t.docx
Earth Science LabIn what order do materials settle in waterSo t.docxjoellemurphey
 
EarlyIntervention Strategies Paper (15 points)The pu.docx
EarlyIntervention Strategies Paper (15 points)The pu.docxEarlyIntervention Strategies Paper (15 points)The pu.docx
EarlyIntervention Strategies Paper (15 points)The pu.docxjoellemurphey
 
Early Hominids & Australopithecus SubscribeWhat is a too.docx
Early Hominids & Australopithecus SubscribeWhat is a too.docxEarly Hominids & Australopithecus SubscribeWhat is a too.docx
Early Hominids & Australopithecus SubscribeWhat is a too.docxjoellemurphey
 
Early scholarly and philosophical manuscripts were in Greek. However.docx
Early scholarly and philosophical manuscripts were in Greek. However.docxEarly scholarly and philosophical manuscripts were in Greek. However.docx
Early scholarly and philosophical manuscripts were in Greek. However.docxjoellemurphey
 
Early Learning & Developmental Guidelines July 2017 1 .docx
Early Learning & Developmental Guidelines July 2017 1 .docxEarly Learning & Developmental Guidelines July 2017 1 .docx
Early Learning & Developmental Guidelines July 2017 1 .docxjoellemurphey
 
Early Innovations and Their Impact Today Wilbur and Orville Wrig.docx
Early Innovations and Their Impact Today Wilbur and Orville Wrig.docxEarly Innovations and Their Impact Today Wilbur and Orville Wrig.docx
Early Innovations and Their Impact Today Wilbur and Orville Wrig.docxjoellemurphey
 
Early childhood professionals have an essential role in creating.docx
Early childhood professionals have an essential role in creating.docxEarly childhood professionals have an essential role in creating.docx
Early childhood professionals have an essential role in creating.docxjoellemurphey
 
Early Constitutional ControversiesIn 1788, Alexander Hamilton and .docx
Early Constitutional ControversiesIn 1788, Alexander Hamilton and .docxEarly Constitutional ControversiesIn 1788, Alexander Hamilton and .docx
Early Constitutional ControversiesIn 1788, Alexander Hamilton and .docxjoellemurphey
 
Early Civilizations MatrixUsing your readings and outside sour.docx
Early Civilizations MatrixUsing your readings and outside sour.docxEarly Civilizations MatrixUsing your readings and outside sour.docx
Early Civilizations MatrixUsing your readings and outside sour.docxjoellemurphey
 
Early childhood teachers need to stay connected to what is occurring.docx
Early childhood teachers need to stay connected to what is occurring.docxEarly childhood teachers need to stay connected to what is occurring.docx
Early childhood teachers need to stay connected to what is occurring.docxjoellemurphey
 
Early and Middle Adulthood PaperPrepare a 1,050- to 1,400-word.docx
Early and Middle Adulthood PaperPrepare a 1,050- to 1,400-word.docxEarly and Middle Adulthood PaperPrepare a 1,050- to 1,400-word.docx
Early and Middle Adulthood PaperPrepare a 1,050- to 1,400-word.docxjoellemurphey
 
Earlier this semester, you participated in a class discussion about .docx
Earlier this semester, you participated in a class discussion about .docxEarlier this semester, you participated in a class discussion about .docx
Earlier this semester, you participated in a class discussion about .docxjoellemurphey
 
EAP1640 - Level 6 Writing (Virtual College, MDC) Author P.docx
EAP1640 - Level 6 Writing (Virtual College, MDC) Author P.docxEAP1640 - Level 6 Writing (Virtual College, MDC) Author P.docx
EAP1640 - Level 6 Writing (Virtual College, MDC) Author P.docxjoellemurphey
 
Earlean, please write these notes for me. October 01, 20181. My .docx
Earlean, please write these notes for me. October 01, 20181. My .docxEarlean, please write these notes for me. October 01, 20181. My .docx
Earlean, please write these notes for me. October 01, 20181. My .docxjoellemurphey
 
eam Assignment 4 Teaming Across Distance and Culture..docx
eam Assignment 4 Teaming Across Distance and Culture..docxeam Assignment 4 Teaming Across Distance and Culture..docx
eam Assignment 4 Teaming Across Distance and Culture..docxjoellemurphey
 
ead the following articleMother Tongue Maintenance Among North .docx
ead the following articleMother Tongue Maintenance Among North .docxead the following articleMother Tongue Maintenance Among North .docx
ead the following articleMother Tongue Maintenance Among North .docxjoellemurphey
 
eActivityGo to the United States Equal Employment Oppo.docx
eActivityGo to the United States Equal Employment Oppo.docxeActivityGo to the United States Equal Employment Oppo.docx
eActivityGo to the United States Equal Employment Oppo.docxjoellemurphey
 
Each year on or around June 15, communities and municipalities aroun.docx
Each year on or around June 15, communities and municipalities aroun.docxEach year on or around June 15, communities and municipalities aroun.docx
Each year on or around June 15, communities and municipalities aroun.docxjoellemurphey
 

Mehr von joellemurphey (20)

Eastern European countries appear to have become dependent on Ru.docx
Eastern European countries appear to have become dependent on Ru.docxEastern European countries appear to have become dependent on Ru.docx
Eastern European countries appear to have become dependent on Ru.docx
 
EAS 209 Second Response Paper Topic Assignment Due .docx
EAS 209 Second Response Paper Topic Assignment Due .docxEAS 209 Second Response Paper Topic Assignment Due .docx
EAS 209 Second Response Paper Topic Assignment Due .docx
 
Earth Science LabIn what order do materials settle in waterSo t.docx
Earth Science LabIn what order do materials settle in waterSo t.docxEarth Science LabIn what order do materials settle in waterSo t.docx
Earth Science LabIn what order do materials settle in waterSo t.docx
 
EarlyIntervention Strategies Paper (15 points)The pu.docx
EarlyIntervention Strategies Paper (15 points)The pu.docxEarlyIntervention Strategies Paper (15 points)The pu.docx
EarlyIntervention Strategies Paper (15 points)The pu.docx
 
Early Hominids & Australopithecus SubscribeWhat is a too.docx
Early Hominids & Australopithecus SubscribeWhat is a too.docxEarly Hominids & Australopithecus SubscribeWhat is a too.docx
Early Hominids & Australopithecus SubscribeWhat is a too.docx
 
Early scholarly and philosophical manuscripts were in Greek. However.docx
Early scholarly and philosophical manuscripts were in Greek. However.docxEarly scholarly and philosophical manuscripts were in Greek. However.docx
Early scholarly and philosophical manuscripts were in Greek. However.docx
 
Early Learning & Developmental Guidelines July 2017 1 .docx
Early Learning & Developmental Guidelines July 2017 1 .docxEarly Learning & Developmental Guidelines July 2017 1 .docx
Early Learning & Developmental Guidelines July 2017 1 .docx
 
Early Innovations and Their Impact Today Wilbur and Orville Wrig.docx
Early Innovations and Their Impact Today Wilbur and Orville Wrig.docxEarly Innovations and Their Impact Today Wilbur and Orville Wrig.docx
Early Innovations and Their Impact Today Wilbur and Orville Wrig.docx
 
Early childhood professionals have an essential role in creating.docx
Early childhood professionals have an essential role in creating.docxEarly childhood professionals have an essential role in creating.docx
Early childhood professionals have an essential role in creating.docx
 
Early Constitutional ControversiesIn 1788, Alexander Hamilton and .docx
Early Constitutional ControversiesIn 1788, Alexander Hamilton and .docxEarly Constitutional ControversiesIn 1788, Alexander Hamilton and .docx
Early Constitutional ControversiesIn 1788, Alexander Hamilton and .docx
 
Early Civilizations MatrixUsing your readings and outside sour.docx
Early Civilizations MatrixUsing your readings and outside sour.docxEarly Civilizations MatrixUsing your readings and outside sour.docx
Early Civilizations MatrixUsing your readings and outside sour.docx
 
Early childhood teachers need to stay connected to what is occurring.docx
Early childhood teachers need to stay connected to what is occurring.docxEarly childhood teachers need to stay connected to what is occurring.docx
Early childhood teachers need to stay connected to what is occurring.docx
 
Early and Middle Adulthood PaperPrepare a 1,050- to 1,400-word.docx
Early and Middle Adulthood PaperPrepare a 1,050- to 1,400-word.docxEarly and Middle Adulthood PaperPrepare a 1,050- to 1,400-word.docx
Early and Middle Adulthood PaperPrepare a 1,050- to 1,400-word.docx
 
Earlier this semester, you participated in a class discussion about .docx
Earlier this semester, you participated in a class discussion about .docxEarlier this semester, you participated in a class discussion about .docx
Earlier this semester, you participated in a class discussion about .docx
 
EAP1640 - Level 6 Writing (Virtual College, MDC) Author P.docx
EAP1640 - Level 6 Writing (Virtual College, MDC) Author P.docxEAP1640 - Level 6 Writing (Virtual College, MDC) Author P.docx
EAP1640 - Level 6 Writing (Virtual College, MDC) Author P.docx
 
Earlean, please write these notes for me. October 01, 20181. My .docx
Earlean, please write these notes for me. October 01, 20181. My .docxEarlean, please write these notes for me. October 01, 20181. My .docx
Earlean, please write these notes for me. October 01, 20181. My .docx
 
eam Assignment 4 Teaming Across Distance and Culture..docx
eam Assignment 4 Teaming Across Distance and Culture..docxeam Assignment 4 Teaming Across Distance and Culture..docx
eam Assignment 4 Teaming Across Distance and Culture..docx
 
ead the following articleMother Tongue Maintenance Among North .docx
ead the following articleMother Tongue Maintenance Among North .docxead the following articleMother Tongue Maintenance Among North .docx
ead the following articleMother Tongue Maintenance Among North .docx
 
eActivityGo to the United States Equal Employment Oppo.docx
eActivityGo to the United States Equal Employment Oppo.docxeActivityGo to the United States Equal Employment Oppo.docx
eActivityGo to the United States Equal Employment Oppo.docx
 
Each year on or around June 15, communities and municipalities aroun.docx
Each year on or around June 15, communities and municipalities aroun.docxEach year on or around June 15, communities and municipalities aroun.docx
Each year on or around June 15, communities and municipalities aroun.docx
 

Kürzlich hochgeladen

Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 

Kürzlich hochgeladen (20)

Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 

Rules1) The object of the game is to beat the dealers score wit.docx

  • 1. Rules 1) The object of the game is to beat the dealer's score with a total equal to or less than twenty one. 2) The game uses a standard deck (or multiple decks of cards). There are no jokers in the deck(s). Face cards count as 10 points each, Aces may count as either 1 or 11, whilst all other cards have their face value. 3) If the game is being played using wagers, then the player must place a wager before the hand is dealt. 4) The dealer then deals two cards to each player. These cards are typically dealt face up. 5) The dealer then deals two cards to himself or herself. One of the dealer's cards is dealt face up, whilst the other card is dealt face down. 6) Play then progresses around the table. A player is allowed several different options with his or her hand. However, we will only implement some of these for our game. a. The player can "hit". That is, the player can request an additional card to add to his or her hand. The player can then select another option. However, if the additional card forces the player over 21, then the player loses and must surrender his or her cards and wager. This is called a bust. b. The player can "stand". That is, the player can keep the value of cards that he or she has. Play progresses to the next player. c. The player can "double down". This is where a player doubles his or her wager. The player then receives an additional card, but cannot receive
  • 2. any additional cards. Play progresses to the next player. 7) After all the players have finished their turns. The dealer turns over his or her hidden card and adds up his or her score. If the score is 17 or more, the dealer is finished. If the dealer's score is 16 or less, then the dealer must "hit" until his or her score is greater than 16 or he or she busts. 8) After the dealer has completed his or her turn, all the remaining hands are compared against the dealer's score. If a player has a higher score than the dealer or the dealer "busted", then the player wins an amount equal to his or her wager. If the player has a score less than the dealer, then he or she loses his wager. If the player ties with the dealer, the game is said to be a "push", and the original wager is returned to the player. 9) BlackJack- This is when a player is dealt an ace and a ten with his or her first two cards. In this case, the player wins 1.5 times his or her wager unless the dealer also has blackjack in which case it is a push. If the dealer has blackjack, then all players who don't have a blackjack lose.There are also special insurance rules for when the dealer shows an ace, but we will worry about these later. In this assignment, you will use classes and dynamic arrays to create a blackjack simulator that pits a single player against the dealer. The game should use the rules given above and should allow a player to keep track of the number of games they won. It is not necessary to implement betting, although you are free to do so if you would like.
  • 3. Classes In order to do this, your program will need to have three separate classes. Card Class First, you will need a class for individual cards. This card class should have member variables for: suit (e.g. spades), value (e.g. jack), and points (e.g. 10). You should obviously have constructors, accessors, and mutators for this class. In addition, you will need to overload the following C++ operators for this class (==, =, <, >, and <<). Deck Class Next, you will need a deck. As a member variable, the deck will need to contain all 52 cards. For ease of implementation, you can put all 52 cards into a vector, since you can shuffle them using the following command: std::random_shuffle( d.begin(), d.end() ); The deck should also have a constructor and a member function that allows you to get a card from it. Overloading the << operator is a good way to test the functionality of the deck, but is not necessary for the program. Hand Class Finally, the hand class will contain the cards in the player’s hand. You must implement this class using a member variable that is a dynamic array of cards for the player’s hand. You will also need to have member variables for the number of cards in the hand as well as the score. Obviously, you should write constructors, accessors, and mutators for this class. Since this class also uses dynamic memory, you will need to write a copy constructor, destructor, and overloaded
  • 4. equal (if implementing splits). The other item that needs to be added to this class is an ability to put an additional card into the hand as player’s will often take additional cards during the game of blackjack. Adding a card to the hand requires reallocating dynamic memory and will be similar to a copy constructor. Implement your program using separate compilation for the voter class and the main program. As always, your code should have appropriate comments to explain the program and the code. It should be written in a consistent and readable form and should compile without errors or warnings.