Question: Could you answer this question? I have no idea what to do. I'll be sure to give a thumbs up!! Thank you for taking time
Could you answer this question? I have no idea what to do. I'll be sure to give a thumbs up!!
Thank you for taking time for me.


Blackjack Lab nment will focus on the use of functions and the passing of rs. You are to construct a C program that plays a simplfied game of assig This blackjack. The rules are as follows . A game consists of several hands, played until the cards run out. In each hand hoth the dealer and the player try to accumulate cards whose point value adds as close to 21 as possible, but not more than 21 First the player gets a card, then the dealer gets a card, then the player gets a second card and the dealer gets a second card. The player then has the opportunity to call for more cards. Her strategy will be to refuse cards when she gets to 16 points or more (i.e., she "hits" 15 or under) If her point value goes over 21, the hand is over and the dealer wins . If the player's point value did not go over 21, the dealer calls for more cards. He must refuse cards when he gets to 17 or more (i.e., he "hits" 16 or under). If he goes over 21 the player wins the hand. Otherwise the hand with the point value closer to 21 wins the hand. In case of a tie, the dealer wins. .If the player is dealt 21 on the first two cards, she has blackjack and immediately wins the hand. If the dealer has 21 on the first two cards, the hand is over and the dealer wins. Cards 2 through 10 count their face value; K, Q, J count 10 points; A counts 1 if the point value in the hand is greater than 10, otherwise A counts 11 A sample deck of cards can be found in: cards.txt. The blackjack program should be organized as follows: The program should contain a function called playHand () which contains two parameters: dealerWin and ranOut (both semi-boolean values). playHand () is to play a hand of blackjack and then set dealerWin to true (1) if the dealer wins and false (0) otherwise. The main() function should repeatedly call playHand () and keep track of the total number of wins in the game using two variables: dealerTotal and playerTotal. However, playHand () should set ranout to true (1) if it ran out of cards. In this case the program should not count this hand, print the total number of wins for both the player and the dealer, and exit. Page 237 Focus on Fundamentals of Programming with C Blackjack Lab nment will focus on the use of functions and the passing of rs. You are to construct a C program that plays a simplfied game of assig This blackjack. The rules are as follows . A game consists of several hands, played until the cards run out. In each hand hoth the dealer and the player try to accumulate cards whose point value adds as close to 21 as possible, but not more than 21 First the player gets a card, then the dealer gets a card, then the player gets a second card and the dealer gets a second card. The player then has the opportunity to call for more cards. Her strategy will be to refuse cards when she gets to 16 points or more (i.e., she "hits" 15 or under) If her point value goes over 21, the hand is over and the dealer wins . If the player's point value did not go over 21, the dealer calls for more cards. He must refuse cards when he gets to 17 or more (i.e., he "hits" 16 or under). If he goes over 21 the player wins the hand. Otherwise the hand with the point value closer to 21 wins the hand. In case of a tie, the dealer wins. .If the player is dealt 21 on the first two cards, she has blackjack and immediately wins the hand. If the dealer has 21 on the first two cards, the hand is over and the dealer wins. Cards 2 through 10 count their face value; K, Q, J count 10 points; A counts 1 if the point value in the hand is greater than 10, otherwise A counts 11 A sample deck of cards can be found in: cards.txt. The blackjack program should be organized as follows: The program should contain a function called playHand () which contains two parameters: dealerWin and ranOut (both semi-boolean values). playHand () is to play a hand of blackjack and then set dealerWin to true (1) if the dealer wins and false (0) otherwise. The main() function should repeatedly call playHand () and keep track of the total number of wins in the game using two variables: dealerTotal and playerTotal. However, playHand () should set ranout to true (1) if it ran out of cards. In this case the program should not count this hand, print the total number of wins for both the player and the dealer, and exit. Page 237 Focus on Fundamentals of Programming with C
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
