In mathematics, a set is an unordered collection of distinct items. Sets support the addition and removal of items, equality, subset, superset, and union and intersection.
You should implement a set class that supports all of the above operations. Assume that the items are integers, and use an array of size 100 to store them (our sets will have a fixed maximum size, but that's ok for now). In addition to the operations mentioned above, include a method called size() that returns the size of the set.
You should also implement a program called UseSet that uses sets. It should call each method of your set class at least once, and print out results showing that it works. You might want to include a toString() method in your set class, as this will facilitate printing out your sets.
Your program should include a Makefile that compiles the different parts of your program.
Your program must be accompanied by a one page ASCII document (.txt format) that shows your design:
Your program must also contain clear and descriptive variable names and comments, and good formatting that enhances the clarity of the program.
REMEMBER: Do not submit object files, assembler files, or executables. Every file in the submit directory that could be generated automatically by the compiler or assembler will result in a 5 point deduction from your programming assignment grade.
sbrandt@cse.ucsc.edu |