Create a librarymaterial class each librarymaterial


Assignment

I'm creating a Library simulation in Java. My current code has a Book class that stores the book information, BookCopy class that handles copies of the book, LibraryCard class that handles the checkout, list of books checked out, due dates, etc. I need to make the following changes to the program.

Create a LibraryMaterial class. Each LibraryMaterial consists of a title and an ISBN.* LibraryMaterialCopy has a library card and due date, they DO NOT contain a LibraryMaterial. Instead, declare LibraryMaterialCopy an abstract class.

What sort of LibraryMaterials does the library have?

* Books. These have the same basics as a LibraryMaterial, plus an author.

* DVDs are NOT Books (for starters, they don't have authors). They areLibraryMaterials, and they have a "main actor" .

For each type of LibraryMaterial, there is also a copy class -- Book and BookCopy, DVD and DVDCopy.

LibraryMaterialCopy is an abstract class. The reason behind this is because there's no such thing as a LibraryMaterialCopy; it must be either a Book or a DVD. So LibraryMaterial is in charge of all basic functionality for checking in and out, but is not associated with a specific LibraryMaterial at the superclass level.

The abstract LibraryMaterialCopy class should have an abstract method, getLibraryMaterial() which will return either a Book or a DVD, depending on the subclass. You may also have abstract getTitle() and getISBN().

In addition to all of the standard methods needed for accessing data and checking out / checking in / renewing / etc., each class should have a print method.

LibraryMaterials (and all superclasses) should print all of the basic information: ISBN, title and (if any): author, main actor.

LibraryMaterialCopy should print LibraryCard checked out to and dueDate.

BookCopy and DVDCopy should print all of the details of the Book/DVD plus the LibraryCard and dueDate.

Print to standard output. The only time that you should do that in a class is within a print() method.

To make matters more complicated, the library has set the following rules for checking out materials:

1. Overdue fines for books are $.10 per day, $1.00 per day for DVDs. An abstract getFinePerDay() method.

2. Books are checked out for three weeks. DVDs are checked out for only two weeks. An abstract getBorrowingPeriod() method.

3. Books are renewable for two weeks. DVDs may not be renewed.

The LibraryCard class should not have any additional functionalities, but will need to be changed to accommodate the changes to the library materials. Please think carefully about the inheritance hierarchy and polymorphism.

Attachment:- Code.rar

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Create a librarymaterial class each librarymaterial
Reference No:- TGS02780509

Expected delivery within 24 Hours