15-111 Intermediate/Advanced Programming
Assignment 2 - SET CLASS
15-111 Sections G and H
Start:          Mon 09-24-01
Due:  11:59 PM Mon 10-01-01
Goal: Implement a set class

Course Web Site:   www.andrew.cmu.edu/~guna/15-111

Assignment:
Write a program implements a set and use set properties.

Specifications:
- This will use only two classes - Driver and Set.   Do not add additional classes
You may use a Vector to hold the set. Remember that a set has no order.
You are to implement the following methods in the set class:

Write the main method to the following.
1. create two sets and add elements (see the sample output)
2. Find the intersection, union, and complement of two sets as shown in the sample output
3. Remove an element from the set (see the sample output)
4. Test two sets for equality. Return true if equal, else return false (see the sample output)
5. Interactively prompt the user for an integer and return true if it contains the element.

Practical Concerns
The template is available from the course web site.  If you have Codewarrior installed, download the CW version of the zip file and extract it. Do not change the names of the files or the classes - Java and Codewarrior will punish you!
Write this in pieces.  Start with the constructor and put in debugging  statements and/or use the debugger.  Once you have
the constructor finished and the code compiling, work on the print( ) method.  Do not go on to other methods until print is working.  Continue in a stepwise manner.  Start tonight and get help as you need it.  Do not wait until next Monday night to start this lab.

Handin
You have to hand in all files - delete nothing.
Use the handin mechanism as demonstrated in class.
Click Here to handin your assignment

Some Last Thoughts
As with lab two, starting sooner is better than later.  Java and Codewarrior should not be as big an obstacle but some of you will still encounter problems.  Starting early provides much time to get help.  Starting late is just stupid - don't do it.  Once again, this is not worth a night' sleep.  Work on this as long as progress is being made.  If you can't get something to work in 15 minutes, quit and do something useful.  Get help later.