|
Fundamental Programming Concepts
Summer 2000 |
|
Clarification/Updates:
Overview |
This project takes the place of a final exam in the course. Expect that
it will take at least the same amount of work and mental energy as
preparing for and taking a comprehensive final. This is your (last) chance
to demonstrate mastery of material in the course.
The only people you may receive help from on this project are Michael and Rick. You may consult any textbook you wish. However, stealing an implementation of any class for this program is a violation of academic integrity. Your project will be graded on the basis of correctness, style, and ease of use (quality of the user interface). You may either write this as a console application or as an applet. Applets will receive up to a 10% bonus. However, I strongly recommend getting the game working as an application FIRST, and then converting it to an applet. Applets that do not function correctly will be graded harshly.
|
Problem Statement |
Implement a program that plays the game of Blackjack. The user will be
the single player in the game, and the computer will be the dealer. Use
the rules specified below. Some class specifications are also provided to
help you.
|
Blackjack Rules |
BasicsThe player competes against the dealer. The object of the game is to have a higher point total than the dealer without going over 21. Each ace counts as either 1 point or 11 points, face cards (kings, queens, jacks) count 10 points each, and all other cards (2 through 9) count their face value. Our blackjack game will be played with a single deck of 52 cards. BettingBefore the deal, the player places a bet. The player may bet any amount from $1 to $100. When a player's bank account falls below $0 the game is over. The player starts the game with $500. Game PlayThe dealer deals two cards to the player and two cards to himself. The player's cards are dealt faceup, while one of the dealer's cards is dealt faceup and the other is facedown. After the deal, the dealer asks the player whether she wants an additional card. The player may "Stand" -- play just the two cards originally dealt or may "Hit"-- take another card. After being dealt an additional card, the player may stop or may take still another card. A player may take as many cards as she wants, but as soon as the player's total exceeds 21, the player loses -- regardless of what the dealer has. After the player stands, the dealer's remaining card is exposed. The dealer must then hit or stand according to these rules:
If the dealer "busts" by going over 21, the player wins. In case of a tie, the player's bet is returned (no money changes hands). If a player's or the dealer's first two cards total 21 (an ace and a 10 or face card), the holding is known as a blackjack. A player with blackjack is paid extra -- one-and-a-half times the original bet -- unless the dealer also has blackjack, in which case the player loses. The player may leave the game between any hands. We will not implement rules for doubling down, splitting, or insurance.
|
Class Specifications |
The game (driver) program itself should be in a class called Blackjack.
The game should make good use of methods to modularize repeated tasks. You
must use at least two additional classes in this project: Card and Deck.
You may design these yourself, or use the specifications provided below.
You might also find it helpful to create other classes, such as Hand,
Player, Dealer, etc.
Specifications:
|
Submitting |
Submit exactly the following:
A project that does not immediately run as submitted will receive no credit. |