Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are building a program that models a library system. You have been given the following interface for the Book class: public interface Book
You are building a program that models a library system. You have been given the following interface for the Book class: public interface Book { } String getTitle(); String getAuthor(); int getNumPages(); Time lef Your task is to implement the Book interface in a class called LibraryBook that represents a book in a library system. LibraryBook should have the following additional methods: public boolean isCheckedOut (); public void checkOut(); public void checkIn(); The isChecked Out() method should return true if the book is currently checked out, and false otherwise. The checkOut() method should mark the book as checked out. The checking method should mark the book as checked in Your implementation should also include a constructor that takes the book's title, author, and number of pages as parameters. Write the code for the LibraryBook class, implementing the Book interface, with the additional methods specified above.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Based on the assignment youve shown in the image youre tasked with implementing the Book interface i...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started