1. Create a class IntegerSet. Each object of the class can hold integers in the range 0 through 100. A set is represented internally as an array of ones and zeros. Array element a is 1 if integer i is in the set and it is 0 if i is not in the set. The default constructor initializes the set to the so classed “empty set Ø or { }” i.e., a set whose array representation contains only zeros. The following operations are to be provided with any IntegerSet Object:
· intersectionOfIntegers: member method that creates a set which is a set-theoretic intersection of two existing sets. i.e., an element of the new set’s array is 0 if that element is 0 in either or both sets, and the element of the new set’s array is 1 if that element is 1 in each of the existing sets.
· unionOfIntegers: member method that creates a set which is a set-theoretic union of two existing sets. i.e., an element of the new set’s array is 1 if that element is 1 in either or both sets, and the element of the new set’s array is 0 if that element is 0 in each of the existing set.
· insertElement: member method that inserts a new integer into the set.
· deleteElement: member method that deletes an integer from the set.
· setPrint: member method that prints the elements of the set. e.g., the set that contains 3, 56, and 100 will be printed as: {3, 56, 100}.
· isEqualTo: member method that determine if two sets are equal.
Write a driver class that a number of inetgerSet objects and manipulate the above operations on them.
Hint: To answer exercise 2 design the UML then write the Java class