W 5 Additional

Create a class called SetOfBooks with the next characteristics:

  • it can store as many elements we need into an array whose type is Book[]
  • adding a book is done as it is describer next:
	- if the element (book) given as a parameter is already stored, this service 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 SetOfBooks class.

Create a SetOfBooks object and save its content into a file whose name is given in the command line. If the name has not been given, the program writes the content of the set into a default file named mySet.txt. Saving the content into the file is done without modifying class SetOfBooks!

Instantiate a SetOfBooks object by reading the content of the previous file. This feature will be done without modifying class SetOfBooks!

Create two instances of SetOfBooks and print if the two sets contain the same books! (NOT MANDATORY)