Project #1 (Blackjack)

CMSC 132

Due Date: Wed Jun 13, 6:00 pm

Object-Oriented Programming II

Type of Project: Open

Summer 2007


Objective

This project will give you practice using ArrayList, and programs that use the MVC (Model-View-Controller) model of interaction.

In case you have not already noticed, this is an Open assignment.  You must read the Open/Closed policy before working on this project.  The policy can be found at policy

Project Clarifications

Any clarifications or corrections associated with this project will be available at: clarifications.html

Overview

For this project you will write a class named Blackjack that implements the game logic associated with a blackjack card game. The Blackjack class implements the BlackjackEngine Java interface whose definition you can find in the project's javadoc documentation

Grading:

For this project:

Code Distribution:

The project's code distribution is available by checking out the project named p1. The code distribution provides you with the following:

Blackjack Rules

If you have been to Vegas then you are familiar with the rules to play blackjack (also known as 21).  However, what happens in Vegas stays in Vegas, therefore the rules for blackjack in this project are different.  If you want to familiarize yourself with the game, check the online blackjack game available at: http://javaboutique.internet.com/BlackJack/index.htmlNote that the rules we will use are not exactly the same ones used in this online game.

In our blackjack version we have a dealer (person who shuffles and distribute cards) and only one player.  The game's objective is for the player to beat the dealer by generating a hand of cards whose value is higher than the dealer's hand without exceeding a total value of 21.  The game starts by the dealer shuffling cards (one or more decks) and dealing two cards to the player and herself/himself (the actual order is described in the project's javadoc documentation).  One of the dealer's cards will be face down.  At this point the player will ask for cards until he/she understand it can beat the dealer with the current hand and as long the cards' total value does not exceed 21.  If the hand of cards does not exceed 21, and the player stops requesting cards (what is refer to as "stand"), then the dealer will flip the card that was face down, and proceed to deal cards to himself/herself as long as the cards' value is less than 16 and does not exceed 21.   If a value greater than 21 is generated the player wins.  Otherwise whoever (player or dealer) has the hand with the highest value will win the game. 

The following provides additional information about the game:

Requirements

Project Requirements

Testing Requirements (please read carefully)

You must provide your own tests in the file StudentTests.java provided with the code distribution. The submit server provides information regarding methods that are not covered by public or student's tests;  Please look at this information while developing your tests. Notice that even though a public test may exist for a method, the test may not test the method for all the possible arguments it can accept.  Therefore, add tests for methods even if they are already tested in a public test. 

We encourage you to thoroughly test your code with your own tests.  This will allow you to pass the release tests sooner plus will help you develop your testing skills (after all, there is no submit server in the real world :)).

If you define any text files for your tests, you must name those files beginning with "studentTest" and ending with the .txt extension. If you don't name files this way, the submit server will generate an authorization error (even if the tests run fine in Eclipse).  By the way, feel free to use the SupportPublicTests.correctResults method for your own tests.  The SupportPublicTests class is part of the code distribution.

Keep in mind that your can use the debugger with JUnit tests.

Style Requirements

Sample Run

The following video illustrates the functionality associated with the application. Game Video

Submission

Submit your project using the submit project option associated with Eclipse.

Academic Integrity

Please make sure you read the academic integrity section of the syllabus so you understand what is permissible in our programming projects.  We want to remind you that we check your project against other students' projects and any case of academic dishonesty will be referred to the University's Office of Judicial Programs.

Web Accessibility