CS 232: Data Structures and Problem Solving

Spring 1999

Assignment 2 (2 Week Lab)

Collection ADT's: The Poker Hand

First Review is Due Monday February 8 (5 pts)

Final Program is Due Monday February 15 (35 pts)

Part 1

Create a class called PokerHand that simulates a five-card poker hand using the Card class (located in ~miller/cs232/lab2). You are to design the class, but it must provide methods to accomplish the following:

Descriptions of the different kinds of poker hands and their relative ranks can be found online. The class should contain a sequence of test code in the main method and should be fully documented with javadoc-style comments.

Submission for First Review

Turn in a hardcopy of PokerHand.java.

Part 2

Create a simple poker game with your PokerHand class and the soon to be provided DeckOfCards class. A hand should be dealt to the computer and another to the player. Allow the player to bet a certain number of cents (or M&M's, or marbles), which the winning hand takes when the contents of both hands are revealed. Place the code that runs the game in Game.java.

Final Submission

For submitting your lab assignment turn in the following hard copies: