Program 3: BlackJack Simulation
Due Date
This assignment is due at the beginning of
your lab period on Thursday, March 11th.
Partners
You may work with at most one other person on
this assignment. Your partner must be in the
same lab section as yourself.
Please review the class collaboration policy
(available off of the main CS 221 page) so that
you know what is and what isn't allowed.
Purpose
The purpose of this program is to give you experience with
the linked list implementation of the list ADT.
Assignment
In this assignment, we want to simulate a BlackJack
dealer in Las Vegas. In the game of BlackJack, the
dealer must draw until she has a score of 17 or higher.
An ace can count as either 1 or 11, a king counts as 10,
a queen counts as 10, a jack counts as 10, and all other
cards count at face value. If the dealer's score exceeds
22, the dealer busts and loses so the dealer tries
to make her cards count between 17 and 21 if this is at all
possible.
The goal of the simulation is have the dealer play
100,000 different hands and to figure out (1) how many
and (2) what percentage of hands end up with each of
the following scores: 17, 18, 19, 20, 21, 22, 23, 24, 25, 26.
General Requirements
- Create a CardDeck class that implements
a deck of 52 cards with an underlying linked list
implementation that you define yourself. (In other
words, do not use built-in linked list implementations!)
The class should include one method
called constructDeck and another method
called shuffle. To do the simulation, you
should call the constructDeck method once
and the shuffle method 100,000 times.
You may choose the other methods that the class should
include.
- Think carefully about the design of your solution before
you begin to code. 20% of the grade will be based on the
quality of the design.
- B Level Requirements: Print the results of the simulation
to the BlueJ terminal output window.
- A Level Requirements: Add a graphical user interface
to the B Level Requirements. The interface should
graphically display the results. The BlueJ terminal
output window should still also be used.
What to Submit
- A disk with your code on it. This is important
as your program will be tested in lab on Thursday,
March 11th.
- A printout of the source code that you write.
- A printout of the output that your program sends to
the BlueJ terminal output window.
Grading
- 50% Correctness
- 20% Good Design
- 10% Good Code
- 10% Good Style (including Javadoc comments).
- 10% The results are displayed graphically.