Question
BlackJack
This game is played between a player and a dealer. (In this exercise there is only one player - you.)
Each person (player, dealer) draws two cards with each card's face counting towards a player's score. Picture cards: Jack, queen, and king count 10. Other cards count whatever number displays.
The object of the game is to get as close to 21 points as possible without going over 21. (Going over 21 points is called 'BUSTING'.) The first one to bust loses that hand. 21 is the best score.
After looking at your initial 2 cards, you can choose to improve your score by taking an additional card. This is known as "taking a hit". That card is added to your total. Most players have a hidden rule that they go by, such as "I must take a hit on 17 or under." You can take hits repeatedly until you bust, or get close enough to 21.
Once the player Stops taking hits, the dealer can take a series of hits. If the dealer busts, you win. If not, you compare scores and the highest score wins.

To make this 'game' easier to program, here are a few simplifying rules for our simulation:
1.) Assume an endless deck - don't worry about 52 cards or the same card being drawn twice.
2.) An ACE always has a value of 1 (one) rather 1 or 11.
3.) Don't worry about double downs or blackjack.
4.) Dealer must hit at 16 or under.
5.) Dealer can't hit at 17 or over.
6.) Player is prompted for the number that is their limit.
7.) Nobody wins ties.
8.) Keep a running total of the player's score and the dealer's score.
Solution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references.
Students may use these solutions for personal skill-building and practice.
Unethical use is strictly forbidden.

This is only a preview of the solution.
Please use the purchase button to see the entire solution.
By purchasing this solution you'll be able to access the following files:
Solution.docx
Purchase Solution
$10.00
Google Pay
Amazon
Paypal
Mastercard
Visacard
Discover
Amex
View Available Computer Science Tutors 641 tutors matched
ionut
Ionut
(ionut)
Master of Computer Science
Hi! MSc Applied Informatics & Computer Science Engineer. Practical experience in many CS & IT branches.Research work & homework
5/5 (6,803+ sessions)
1 hour avg response
$15-$50 hourly rate
Pranay
(math1983)
Doctor of Philosophy (PhD)
Ph.D. in mathematics and working as an Assistant Professor in University. I can provide help in mathematics, statistics and allied areas.
4.6/5 (6,660+ sessions)
1 hour avg response
$40-$50 hourly rate
Leo
(Leo)
Doctor of Philosophy (PhD)
Hi! I have been a professor in New York and taught in a math department and in an applied math department.
4.9/5 (6,419+ sessions)
2 hours avg response

Similar Homework Solutions