W 4 Additional
Create a class called Set with the next characteristics:
- the maximum number of the elements the set contains is given as a parameter to the constructor of the class
- the elements of the set are stored into an array whose type is Book[]
- adding a book is done as it is describer next:
- if the maximum capacity has been reached, this service fails (the method returns false) - if the element given as a parameter is already stored, this service also fails (the method returns false) - if the element has not been already stored, it is stored and the service returns true.
- a method for performing the union among two sets.
- a method for printing the books of the set.
Each book has a title and an author.
Create a class SetClient with a main method for exemplifying the functionalities provided by the Set class.