Write a program that scores a blackjack hand. In the blackjack, aplayer receives
ID: 3617027 • Letter: W
Question
Write a program that scores a blackjack hand. In the blackjack, aplayer receives either2,3,4 or 5 cards. The cards labeled 2 through10 are scored respectively 2 through 10 points each. Facecards(jack, queen, and king) are scored as 10 points. The ace cancount as either 1 or 11 whichever is better for the player. Thegoal is to come as close to a score of 21 as possible without goingover 21 the player looses( the player is busted).your program should prompt the user to enter the number of cards heo she has. After checking that a valid number has been entered, youshould ask the user to enter the card values. A good way to handleinput is to use a char variable so that the user can input 2through 9, t, j, q, k, or a as the value of a given card. Be sureto handle both uppercase and lowercase letters as input. use aswitch statement to handle the various values. You will have totake special care for aces. The output is either a number between 2and 21(inclusive) or the word "BUSTED". your program should includea do while loop that the user repeat the calculation until the usersays she or he is done.
Use the following hand as one of the test cases: Ace, Ace,9
Explanation / Answer
please rate - thanks what does a t indicate as input? user can input 2 through 9, t, j, q, k, or a as the value of agiven card #include using namespace std; int main() {int cards,score,i,j,acecount; char card; coutcards; while(cards!=-1) {while(cards5) {coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.