Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement the following classes using Java: BookSho +title: String +author: String ISBN: int + price: double + numberOfCopies: int books: Book 1.. .n Date: java.util.

image text in transcribed
Implement the following classes using Java: BookSho +title: String +author: String ISBN: int + price: double + numberOfCopies: int books: Book 1.. .n Date: java.util. Date Book() Book(tile:String, author:String. ISBN:int, + Library(books:Book) + addBook(book:Book): void +removeBook(ISBN:int):void + isAvailable(ISBN:int):boolean + sortBooks0: void +toString O: String price:double, numberOfCopies int) +toString O: String Academic Novel + edition: int - fiction: boolean + Academictitle:String, author.String, ISBN:int, price:double, numberOfCopies int, edition: int) +toString O: String +Novel(title:String, author String. ISBN:int, price:double, numberOfCopies:int, fiction: boolean) +toString 0: String +isFiction0: boolean Notes: 1) The toString method should be overridden in all implemented classes to return values of all their data fields. For subclasses Academic and Novel, it should return values of inherited data fields as well. For the BookShop class it should return the details of all books in the shop, each book on a separate line by invoking the toString method of the Book class. 2) The removeBook method should remove the book with the passed ISBN argument from the books 3) The isAvailable method should check whether the book with the passed ISBN argument is 4) The sortBooks method should sort the books of the books array according to their entry dates array available by searching for it in the books array and checking that its number of copies does not equal 0 from the oldest entered book to the newest entered book

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beyond Greed And Fear Understanding Behavioral Finance And The Psychology Of Investing

Authors: Hersh Shefrin

1st Edition

0195161211, 978-0195161212

Students also viewed these Databases questions