|
Wyo Java Ch20Proj1 |
|
Write a class named Ch20Proj1 that contains the following static methods.
In this assignment, you must use HashSets however the Set reference type is used above so that the same methods could also be used with TreeSets. The union method must merge all of the elements of its two parameters into one set that is returned. The intersection method returns a set that is created from all of the elements that are in both of its parameter sets. The difference method combines all of the elements in set1 that are not in set2 with all of the elements that are in set2 but are not in set1 and returns that resulting set. The isASubset method determines if the parameter subset is a subset of the parameter superset and returns a true if it is and false otherwise. Be sure to execute code that makes the program easy to grade (i.e. print out the contents of the sets where necessary to show that the algorithms work correctly.). Your program must follow the class Coding Standards. Save all of the files associated with this assignment to a folder named Ch20Proj1 in the appropriate network folder. Submit the printed code stapled to a screen capture of the runtime output. |