Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92823693

Have any Question?


Related Questions in Computer Engineering

Explain and discuss the following quotepoliticians can be

Explain and discuss the following quote: "Politicians can be strange. They have been calling for the breakup of firms as diverse as energy companies and tech giants like Microsoft and Google because they believe these co ...

Question suppose you are in the process of drawing the dfds

Question : Suppose you are in the process of drawing the DFDs, and you have found that one of your Level 1 DFD describing a process in level 0, has more than 8 sub-processes. What does that indicate? And How do you fix i ...

Given the ultra-high abundance of their elements in air it

Given the ultra-high abundance of their elements in air, it is not surprising that these six compounds are common pollutants: NO, NO2, N2O, N2O3, N2O4, N2O5. Calculate the largest ratio of effusion rates that exists betw ...

A student finds that 2496g of water at 249 ordmc density

A student finds that 24.96g of water at 24.9 ºC (density= 0.9971 g/cm3 ) is required to completely fill an empty flask. The water is removed and completely dried; granular solid copper weighing 51.24g is then added to th ...

Question suppose you have to design a mobile application to

Question : Suppose you have to design a mobile application to control your microwave over internet. Define the objective, assumptions and Interface Metaphors of this application.

System analysis and design1 why is it important to keep the

System Analysis and Design 1) Why is it important to keep the output simple for display-based output technology? 2) Why is it important to consider how users learn when developing output? Explain. 3) Describe the differe ...

Question suppose a process ie parent forks a child process

Question : Suppose a process (i.e., parent) forks a child process using resource sharing such that the parent and child share all resources. Does this include the Process Control Block and memory space or does the child ...

1nbsphillary wants to go to disneyland in 425 years she

1) Hillary wants to go to Disneyland in 4.25 years. She wants to take her partner and 2 kids (4 people in Total). If it is going to cost $453.27 per person to go on the trip. -What will the cost be for the entire trip? - ...

Design a automatic room climate control system with

Design a automatic room climate control system with contextual model, state transition diagram

Research and describe a tool that can be used to test for

Research and describe a tool that can be used to test for web server vulnerabilities. This tool can be as simple as a Google Dork or it can be included in a toolkit for performing enumeration. Why is this tool valuable t ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As