Practice using if statements.
Assignment Hit or Stand
For this assignment, you will write a program that tells the user to "hit" or "stand" in a game of Blackjack (also known as Twenty-one).
Blackjack is a casino card game where the objective is to have the cards you are dealt total up- as close to 21 as possible. If you go over 21 (a bust), you lose. The cards are from a standard deck (most casinos use several decks at once). Cards 2-10 have the values shown. Face cards (Jack, Queen, and King) have value 10. An Ace is either 1 or 11, whichever is to your advantage.
Each player is initially dealt two cards face up. The dealer is given 1 card face up and 1 card face down. Then, each player gets one turn to ask for as many extra cards as desired, one at a time. To receive another card, the player "hits". When no more cards are wanted, the player "stands". Wikipedia has a more comprehensive description of the game https://en.wikipedia.org/wiki/ Blackjack.
The strategy that you will implement is a rather simple one. You will probably lose money slowly in a casino
if you follow this strategy. (If you don't follow a strategy like this one, you will lose money quickly). .
If your cards total 17 or higher, always stand regardless of what the dealer is showing in their face-up card. .
If your cards total 11 or lower, always hit..
If your cards add up to 13 to 16 (inclusive), hit if the dealer is showing 7 or higher, otherwise stand.
If your cards add up to 12, hit unless the dealer is showing 4 to 6 (inclusive). In that case, stand. •
Please name your program blackjack.c. .
You will use lots of if statements. For ease of debugging, make sure that you indent your program properly. Always, use curly braces, and, even when the body of the if or else part only has a single statement. •
Use && for logical AND and || for logical OR.
You may have to use if statements inside another if statement.