Lab 5: Array Based Structures and Yukon Solitaire
CS 241: Data Structures, Fall 2007


Due Date: midnight on Thursday Oct 11

Goals for this assignment are to learn about:

Reading

Chapter 5 and 6

Directions

  1. Create a new Netbeans project. Add a "card" package containing the Card and Deck classes as described in the text. Test your classes well before moving on to the next step. For example, print out the deck before and after shuffling, and before and after dealing. Print the cards that are being dealt.
  2. Create a "lists" package and add the ArrayStack, ArrayQueue, and ArrayList classes that are given in the text. Note, you also need to include the associated interfaces (Stack.java, Queue.java, and List.java), the iterator class (ArrayIterator.java) and the exception class (EmptyStructureException.java). To get started, here are the Stack.java, ArrayStack.java, and Queue.java files. Test all of your classes before continuing.

  3. Carefully review the setup and rules of Yukon Solitaire. Get a real deck of cards and try playing the game several times (chance of winning is 1 in 4). Think about the types of list structures that would be best for each of the different components of the game. To do this, think about all operations you will need to perform on each part (adding cards, removing cards, printing out the cards, etc). Write down a simple UML diagram for your game before you begin to program.

  4. Misc other recommendations

Evaluation

On Monday Oct 8 in class, we will go over your UML design. Be sure to bring these to class. They will not be collected.

By midnight on Thursday Oct 11, zip together the entire project (containing the card, lists, and game packages) and email the code as an attachment to gorr@willamette.edu. Make sure a working jar file is included. Place CS241 Lab 5 in the subject line.

By Tuesday Oct 16 you should have demonstrated your code to the instructor.


[top]  [Schedule]  [Home]