Question: In this task you will implement a game of blackjack between a single player and an automated dealer. Background Let's now talk about how a

In this task you will implement a game of blackjack between a single player and an automated dealer.
Background
Let's now talk about how a round of blackjack actually plays out. For the sake of simplicity, we will focus on how the game works when there is only a single player, and when the game only lasts for a single round, and when there are no bets involved.
A round of blackjack with a single player involves the following steps:
The initial deal
The dealer deals one card to the player, and then one to themselves. These cards are all dealt face up (meaning that everyone can see the cards).
The dealer then deals a second card to the player, and a second one to themselves. The player's card is dealt face up, but the dealer's one is played face down.
Resolving naturals
If the dealer's first card is an 10, jack, queen or king or ace, they will privately look at their second card to see if they have a natural pair (i.e. a pair of cards with a score that is exactly 21).
If the dealer does not have a natural pair, then play moves on to the players turn.
Otherwise, play immediately stops. If both the player and the dealer have natural pairs, the game ends in a tie. If only the dealer has a natural pair, then the dealer wins.
The player's turn
The player chooses to hit or stay.
If they choose to stay, then play moves on to the dealers turn.
If they choose to hit and go bust, then play immediately stops and the dealer wins.
If they choose to hit and do not go bust, they again choose to either hit or stay. They can continue to make this choice until they eventually go bust or choose to stay.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!