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.

I am struggling with these methods and how to implement them. Iunder stand the Enum part but the hasBook(), getBook() Im not sure

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 * Reader(int, String, String) 19 addBook (Book) Code removeBook (Book) Code hasBook (Book) boolean m getBookCount() int getBooks) List setBooks (List) void 4 getCardNumber() int setCardNumber(int) void I getName() String 19 setName(String) void getPhone() String 1 setPhone(String) void The equals(Object) boolean hashCode() int 4 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!