Write a program that scores a blackjack hand. Â In blackjack, a player receives
ID: 3535458 • Letter: W
Question
Write a program that scores a blackjack hand. Â In
blackjack, a player receives from 2 to 5 cards. The player decides
how many, but hat has no effect on this problem. The cards 2
through 10 are scored as 2 through 10 points. The face cards
– jack, queen, and king are scored as 10 points.
The ace is either 1 or 11, whatever is better for the user. The
goal is to come as close to a score of 21 as possible without going
over 21. Hence, any score over 21 is called
“bustedâ€.  The user is
asked how many cards she/he has and the user responds with one of
the integers 2, 3, 4, or 5. Â The user is then asked for
the card values. Â Card values are 2 through 10, jack,
queen, king or ace. After reading the values the program should
convert them from character values to numeric card scores, taking
special care for aces. Â The output is either a number
between 2 and 21 (inclusive) or the word Busted. Â The
user will determine when to end the program.
Explanation / Answer
int main() { int number_of_cards(0), deuce(0), three(0), four(0), five(0), six(0), seven(0), eight(0), nine(0), ten(0), jack(0) queen(0), king(0), ace(0) char card; do { cout number_of_cards; coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.