Program 3: BlackJack Solitaire Simulation

Purpose

The purpose of this assignment is to design and implement a Java program that simulates a solitaire version of BlackJack.

Partners

You may (and are encouraged to) work with at most one other partner on this assignment. You and your partner must be in the same lab section. If you work with a partner, submit one solution with both of your names on it.

Assignment

Create a BlueJ project named Program3 and place the following files in it:

Your task is to modify the CardDeck and Card classes such that a solitaire version of BlackJack (described below) can be simulated. The BlackJack class should be left alone and not modified.

BlackJack Solitaire Background

Before the simulation is begun, the user will be asked to supply a lower bound between 1 and 21. Call this value lowerBound.

Each time a game is simulated, the following steps should occur:

  1. Shuffle a regular, 52 card deck of cards.
  2. Deal the cards one at a time. If the total value of the cards dealt is ever greater than or equal to lowerBound and less than or equal to 21, the game is won. If the total value of the cards dealt ever exceeds 21, the game is lost.

In BlackJack, the value of a card is as follows:

Getting Started

The three files that you are given will compile and run. Make sure that you understand them well before beginning. Notice that the CardDeck class contains the following methods that currently do nothing:

Grading (50 points possible)

Submission

E-mail the CardDeck.java and Card.java files as an attachment to your lab TA no later than the start of your lab on Tuesday, October 28th. Late submissions receive no credit, but partial credit can be earned by making an ontime submission. The subject of the e-mail should be CS 160, Program 3, your name, your partner's name.

Valid XHTML 1.0!