Objective: create a simple object, put that object in a simple collection class, use that object and collection in a simple GUI application.
Specification: Consider a Library that contains Books. The Book class has attributes for the author, title and number of copies and methods for getting/setting the attributes, borrow a book and return a book.
The Library class stores a collection of Book objectsin an ArrayList.
The program should have the following functionalities:
- add/delete a book from the Collection
- borrow/return aselected book. When borrowing a Book object the number of copies attribute should decrease by 1 while when returning the Book object the number of copies attribute should increase by 1. You should check if the number of copies gets 0.
The class diagram for the classes described above is depicted in Figure.
Implement the classes defined above and provide a simple GUI to handle them. The GUI may look like Figure
Do not consider at this time Exceptions.
Submit in the Assignments folder under the Project1 link the source files of your project (.java files).