Question: I am struggling with these methods and how to implement them. I under stand the Enum part but the hasBook(), getBook() Im not sure exactly
I am struggling with these methods and how to implement them. I under stand the Enum part but the hasBook(), getBook() Im not sure exactly how to code those. Any assistance would be greatly appreciated.


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) If 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. getBook Count 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 UML Diagram of Reader.java Reader * CARD_NUMBER_ int 4 NAME_ int DPHONE int BOOK_COUNT_ int BOOK_START_ int cardNumber int name String phone String books List
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
