Trusted by 2+ million users, 1000+ happy students everyday
Showing pages 1 to 1 of 2 pages
Advanced c++ – Playing Blackjack (21)400 points – Due Date –Dec 9 - NO late assignments will be accepted.You are to create a program to play 21(blackjack) against the computer.The rules of blackjack can be found on many internet sites. You will use the basic rules, no splitting etc... Example of the rules are as follows:The dealer gives one card face up to each player, and then one card face up to himself. Another round of cards is then dealt face up to each player, but the dealer takes his second card face down. Thus, each player except the dealer receives two cards face up, and the dealer receives one card face up and one card face down.Each player must decide whether to "stand" (not ask for another card) or "hit" (ask for another card in anattempt to get closer to a count of 21, or even hit 21 exactly). Thus, a player may stand on the two cards originally dealt him, or he may ask the dealer for additional cards, one at a time, until he either decides to stand on the total (if it is 21 or under), or goes "bust" (if it is over 21). –Each player attempts to beat the dealer by getting a count as close to 21 as possible, without going over 21. When the dealer has served the player, his face-down card is turned up. If the total is 17 or more, he must stand. If the total is 16 or under, he must take a card. He must continue to take cards until the total is 17 or more, at which point the dealer must stand. If the dealer has an ace, and counting it as 11 would bring his total to 17 or more (but not over 21), he must count the ace as 11 and stand. The dealer's decisions, then, are automatic on all plays, whereas the player always has the option of taking one or more cards. You may choose any logic/data structure you like for this program, but you must at least do the following:You will display the 21 rules you are using for your program You will use only one deck of cards, see below:Example set of 52 playing cards; 13 of each suit clubs, diamonds, hearts, and spades (you will NOT be usinggraphics in this program... only the name and type of the card will be displayed)Ace2345678910JackQueenKingClubsDiamondsHeartsSpadesYou must load all cards into memory when your game begins. (this has been done for you in the play21.cpp file and you must use this data structure). You will deal cards
Found this document preview useful?
You are reading a preview Upload your documents to download or Become a Desklib member to get accesss