CSC 7000 - Algorithms and Programming

Project #5

Due 9am Wednesday, February 20, 2002

Programming projects 4.3 (p218) and 6.8 (p317). For this project you need to implement the classes for Card and DeckOfCards as described in the textbook questions. Note that the shuffle method should rearrange the cards in the deck -- do not try to generate random cards here, because you will get duplicates! It is easier (and more realistic) to have two methods:

The driver class should contain a main method that: If you want to be more creative and/or ambitious, you can have the program then go on to do something else. Please bear in mind that:
  1. The program should first do what is required
  2. It should require no input from the user
  3. It should run in a single window as a stand-alone application
Enhanced versions, including applets, are also welcome, but they should be submitted on a floppy (not by email) and they should be in addition to (not instead of) the normal (text) version that is required.

Note that you should develop your program in three files, but please then combine them into a single file DealCards.java so that it can be submitted (and collected) in one step. Note that when you combine the class declarations into a single file, the class that contains the main method should be public (in this case this class has to be called DealCards to match the filename); all other classes should no longer have public visibility.

Be sure to test it well. Your program must be well documented and formatted and please remember to put some extra comments and blank lines at the beginning and end of the file, so as to avoid the submission problems that we experienced in the past.