This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Programming Assignment 4: Blackjack COP 3014 - Spring Term 2008 Point Value: 100 points Project Due Date: Friday March 21, 2008 Learning Objectives z To write a program making use of multiple functions in a well-structured design z To gain experience writing and calling functions to perform various tasks z To understand and correctly use call by value and call by reference parameters z To gain a deeper knowledge of programming more complex tasks in C++ z To utilize pseudo-random number generation to simulate a game of chance Problem Statement For this assignment, you will write a program which simulates a simplified version of the game Blackjack , or 21 . The game uses the following rules: (1) There is one person who is the permanent dealer. For this simulation, assume there is only one other person in the game, the "player." At the start of every hand the player decides how many "chips" he wants to bet on that hand. (2) The dealer then deals out 4 cards. The 1st card goes to the player, the 2nd to the dealer, the 3rd to the player, and the 4th to the dealer. (3) Each card is worth a certain number of points. Cards with numbers on them (2-10) are worth their face value. That is, a 3 is worth 3 points, a 9 worth 9 points, and so on. Jacks, Queens, and Kings are worth 10 points each. Aces are always worth 11 points. The value of a hand is simply the sum of the Page 1 of 5 Programming Project Specifications 2/6/2008 file://C:\Users\aft\Documents\01_workingOn\p4sp08_3014\p4sp08writeup_3014.htm values of each card. Thus if you held a 6 and a Queen, your hand would be worth 16 points, A 4, a 5 and an Ace would be worth 20 points, and so on. (4) The purpose of the game is to have a hand that is worth more points than your opponent's. However, you may NOT exceed a total of 21 points. If you do go over 21, you lose immediately ( go bust ). (5) After the initial 4 cards have been dealt, it becomes the player's turn to decide if he is satisfied with his hand. If he believes he has enough points to win, he says "I stand". If he wishes, however, he may ask the dealer to give him an additional card by saying, "Hit me." His score is then the sum of all 3 cards. Again he has the option of standing or requesting still another card. The player may continue to request as many more cards as he wishes, until he is satisfied, or until his total becomes > 21, at which point he loses instantly....
View Full Document
This note was uploaded on 04/20/2008 for the course GEO 1414 taught by Professor Steinberg during the Spring '08 term at FSU.
- Spring '08