Question: Need help developing this Java program Method Details addBook(Book book) If the Reader already has a copy of book addBook returns a Code. BOOK_ALREADY_CHECKED_OUT_ERROR; Otherwise

 Need help developing this Java program Method Details addBook(Book book) If the Reader already has a copy of book addBook returns a Code.

Need help developing this Java program

Method Details addBook(Book book) If the Reader already has a copy of book addBook returns a Code. BOOK_ALREADY_CHECKED_OUT_ERROR; Otherwise add the book to the List of books in the reader object and return a Code. SUCCESS; removeBook(Book book) the reader doesn't have the book in their possession removeBook should return a Code. READER_DOESNT_HAVE_BOOK_ERROR If the book is successfully removed from the list of Books then a Code.SUCCESS should be returned. For any other issue a Code. READER_COULD_NOT_REMOVE_BOOK_ERROR should be returned. getBookCounto Returns the count of books. In other words the number of books in the List of books. hasBook(Book book) Returns true if the user has the book in their list equals() Compares all the fields except the list of books. hashCode Uses all the fields except the list of books. toString() Returns a string that looks like: Bob Barker (#2187) has checked out {Book1, Book 2) Where Bob Barker is the name stored in the name field, 2187 is the card number, and the books listed are all the books in their inventory. UML Diagram of Reader.java Reader 1 CARD_NUMBER_ int NAME int PHONE int 1 BOOK_COUNT_ int 1 BOOK_START_ int cardNumber int name String phone String A books List Reader(int, String, String) m. addBook(Book) Code m removeBook (Book) Code m. hasBook(Book) boolean m 2 getBookCount() int m getBooks () List m setBooks (List) void m. getCardNumber() int m setCardNumber(int) void m. getName() String m2 setName(String) void m getPhone() String m setPhone(String) void m1 equals(Object) boolean m. hashCode() int m.toString() String

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!