Question: This is a blackjack program. In the beginning, you have $ 1 0 0 0 to play the game. You and the dealer are given

This is a blackjack program. In the beginning, you have $1000 to play the game.
You and the dealer are given a deck of 52 cards shuffled.
For each game, you need to bet some money, say x dollars.
- if you win, your total money =1000+ x
- if you lose, your total money =1000-x
- if you tie with the program, your money has no change.
Game Rules:
(1) At first, you, the player, need to bet some money.
(2) Reuse the HW3.A function to draw two card from the top of the deck for the player.
add two the points of the two cards for the player
(3) Do the same for dealer in the same manner.
(4) Hide dealer's cards and total points to player. Display only player's cards and points.
(5) After you see your first two cards, you have the 2 more chances to draw an additional card (hit). You also can pass (stand) without drawing any more cards. If total points >21, it goes bust, then points =0.
(6) If you draw an additional card, dealer will do the same.The bust also applies to the dealer.
(7) Display all physical cards and total points (yours and dealer)
(8) Compare your total points with dealer's:
- if yours is higher than the dealer's, you win
- if equal, tie
- if yours is lower, you lose
(9) Now you finish one game.
The program will ask if the player plays again or not. Player can play until you want to quit or no more money left or not card left in the deck. Finally, the game is over. Print out the player's balance($ amount).
Ignore the Blackjack(If you start (Ace & 10))
'Hit': ask for another card.
'Stand':hold your total and end a game.
'Bust': over 21 points

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!