Question: This is a JAVA assignment. This assignment involves the development of a library system. The library can store up to 100 books. Each book has

This is a JAVA assignment. This is a JAVA assignment. This assignment involves the development ofa library system. The library can store up to 100 books. Each

book has information of title, author, year, and the borrowed status (trueor false). The library allows adding new books to it, checking out

a book, and returning a book. We assume different books have different

This assignment involves the development of a library system. The library can store up to 100 books. Each book has information of title, author, year, and the borrowed status (true or false). The library allows adding new books to it, checking out a book, and returning a book. We assume different books have different titles in the library. The general rules of the systems include When adding a new book to the library, the borrowed status of that book is false by default. Make sure that you only add a new book to the library if the maximum capacity of library (100) has not been reached. If the maximum capacity is reached, no need to increase its maximum capacity and simply print an appropriate error message. e If checking out a book that doesn't belong to the library, print an appropriate error message. If checking out a book that does belong to the library but has been checked out, print an appropriate message. Otherwise, successfully check out that book and set its borrowed status to true. If returning a book that doesn't belong to the library, print an appropriate error message. Otherwise, successfully return that book and set its borrowed status to false. You need three classes: 1. Book: instance variables, constructors, getters and setters, and toStrina) method 2. Library: instance variables, constructors, add (title, author, year), findBook (searchTitle), checkOutBook (title), returnBook (title), and tostring ) method. MyLibrary: we already provide this driver class to you. 3. Hint: When implementing the method findBook in the Library class: if the specified book title is in the library, return its index in the array of Book references; otherwise, return a negative value such as -1 to indicate that the specified title is not in the library. You may find the slides of Class 19 and Class 20 as well as pp. 396-401 of the textbook helpful. If you have correct implementation, you should expect to the exact output at the end of this document

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!