CS 111: Fundamentals of Programming 1

Lab 9

Goals

To work with

Main Goal

For Lab 8 you developed a program to play Blackjack. To do this, you made use of three classes, Card, Player and Dealer, that I provided you. This week you are to develop those classes yourself. You will continue to use your BlackjackInterface class from last week. Be sure to follow the specifications exactly. You should not have to make any changes to BlackjackInterface. In fact, I may well substitute my BlackjackInterface class when testing your classes.

Step 1 - Make a copy of your Lab8 folder and name it Lab9.

Step 2 - Open BlueJay and open the Blackjack project in Lab9.

Step 3 - Remove the Card class.

Right click on the Card class icon and take "remove".

Step 4. Create a new Card class - click on new class button.

You are to write the code for the Card class. Instances of this class should have

Step 5 - Test the Card class

Once you have compiled the card class, right click on its icon and execute its constructor method to create a Card object. Now right click on the object's icon and execute its getPoints method to see the value it has. Repeat this with a couple more Card objects.

Step 6 - Test the Card class with your BlackjackInterface program

Step 7 - Remove Player class and create a new one.

You are to write code for the Player class. Instances of this class represent players for a simple version of Blackjack. They should have

Step 8. Test the Player class with Bluejay objects and your BlackjackInterface program.

Here you should use Card objects as well.

Step 9. Remove the Dealer class and create a new class called Dealer

The dealer will be consider as a special player; so the Dealer class should be a subclass of Player. Instances of this class should have, in addition to the properties of Player,

Step 10. Test the Dealer class with Bluejay objects and your BlackjackInterface program.

Here you should use Card and Player objects as well.

Step 11. Turn in your work.

When you have completed all work on this lab, you should turn in a print out for each of your classes. Be sure to adhere closely to specifications given. Also adhere to points of programming style. Points will be deducted for poor choice of variable names, poor indentation and placement of braces, lack of pre and post conditions, etc.

You should also copy your Lab9 folder into your turnin folder.

Be sure to follow the honor code specifications on the syllabus.