I need help with the program below will. It requires knowledgeof loops and funti
ID: 3617705 • Letter: I
Question
I need help with the program below will. It requires knowledgeof loops and funtions. Write a program thatscores a blackjack hand. In blackjack, a player receives from twoto five cards. (The player decides how many, but that has no effecton this exercise.) The cards 2 through 10 are scored as 2 through10 points each. The face cards, jack, queen, and king are scored as10 points. The goal is to come as close to a score of 21 aspossible without going over 21. Hence, any score over 21 is called"busted." The ace can count as either 1 or 11, whichever is betterfor the user. For example, an ace and a 10 can be scored as either11 or 21. Since 21 is a better score, this hand is scored as 21. Anace and two 8' s can be scored as either 17 or 27. Since 27 is a"busted" score, this hand is scored as 17. The user is asked howmany cards she or he has, and the user responds with one of theintegers 2, 3, 4, or 5. The user is then asked for the card values.Card values are 2 through 10, jack, queen, king, and ace. A goodway to handle input is to use the type char so that the card input2, for example, is read as the character '2', rather than as thenumber 2. Input the values 2 through 9 as the characters '2'through '9'. Input the values 10, jack, queen, king, and ace as thecharacters 't ', 'j', 'q', 'k', and 'a'. An ace can also be enteredas a '1'. (Of course, the user does not type in the single quotes.)Be sure to allow upper as well as lowercase letters as input. Afterreading in the values, the program should convert them fromcharacter values to numeric card scores, taking special care foraces. The output is either a number between 2 and 21 (inclusive) orthe word Busted. Use functions where appropriate. Use a switchstatement to determine the correct value for a card. Your programshould include a loop that lets the user repeat this calculationuntil the user says she or he is done.ExampleOutput:
Enter the number of cards: 3
Enter cards: a78
The value of your hand is 16.
Would you like to score another hand (Y or N)?: y
Enter the number of cards: 4
Enter cards: 354K
You are BUSTED!
Would you like to score another hand (Y or N)?:n Any help with this would be greatthanks. I need help with the program below will. It requires knowledgeof loops and funtions. Write a program thatscores a blackjack hand. In blackjack, a player receives from twoto five cards. (The player decides how many, but that has no effecton this exercise.) The cards 2 through 10 are scored as 2 through10 points each. The face cards, jack, queen, and king are scored as10 points. The goal is to come as close to a score of 21 aspossible without going over 21. Hence, any score over 21 is called"busted." The ace can count as either 1 or 11, whichever is betterfor the user. For example, an ace and a 10 can be scored as either11 or 21. Since 21 is a better score, this hand is scored as 21. Anace and two 8' s can be scored as either 17 or 27. Since 27 is a"busted" score, this hand is scored as 17. The user is asked howmany cards she or he has, and the user responds with one of theintegers 2, 3, 4, or 5. The user is then asked for the card values.Card values are 2 through 10, jack, queen, king, and ace. A goodway to handle input is to use the type char so that the card input2, for example, is read as the character '2', rather than as thenumber 2. Input the values 2 through 9 as the characters '2'through '9'. Input the values 10, jack, queen, king, and ace as thecharacters 't ', 'j', 'q', 'k', and 'a'. An ace can also be enteredas a '1'. (Of course, the user does not type in the single quotes.)Be sure to allow upper as well as lowercase letters as input. Afterreading in the values, the program should convert them fromcharacter values to numeric card scores, taking special care foraces. The output is either a number between 2 and 21 (inclusive) orthe word Busted. Use functions where appropriate. Use a switchstatement to determine the correct value for a card. Your programshould include a loop that lets the user repeat this calculationuntil the user says she or he is done.
ExampleOutput:
Enter the number of cards: 3
Enter cards: a78
The value of your hand is 16.
Would you like to score another hand (Y or N)?: y
Enter the number of cards: 4
Enter cards: 354K
You are BUSTED!
Would you like to score another hand (Y or N)?:n Any help with this would be greatthanks.
Explanation / Answer
#include <iostream.h>#incl