Create a librarymaterial class

Assignment Help Computer Engineering
Reference no: EM131986041

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

Reference no: EM131986041

Questions Cloud

Incremental cash flows and present values : Calculate the following from the data below - incremental cash flows-present values-NPV (net present value)-IRR.
Write a program that fulfills the requirements specified : Write a program that fulfills the requirements specified here: Read and parse the "From" lines and pull out the addresses from the line.
Do you think that more multi-housing-apartment complexes : 1. Do you think that more multi-housing/apartment complexes should be smoke-free? Discuss why or why not.
Finite math given that said student is taking history : The randomly selected student is taking Finite Math given that said student is taking History
Create a librarymaterial class : Create a LibraryMaterial class. Each LibraryMaterial consists of a title and an ISBN.* LibraryMaterialCopy has a library card and due date.
Present descriptive statistics of variables remuneration : MAE256 - Analytical Methods in Economics and Finance - Regression Models using Cross Section Data -Present the descriptive statistics of variables remuneration
Why is learning to control their impulses important : Do you agree with Psychologist Walter Mischel (who did the original Marshmallow Test) that "self control is the engine of success"?
Conduct an experiment in which you break a folkway : Conduct an experiment in which you break a folkway, a norm governing everyday behavior, and answer a series of response questions applying concepts.
Briefly describe the public health problem and the policy : This assignment will allow you to examine a public health policy and understand the factors that led to the creation of the policy.

Reviews

Write a Review

Computer Engineering Questions & Answers

  As the lead analyst for the hoosier burger project you have

as the lead analyst for the hoosier burger project you have worked closely with bob and thelma nbspmellankamp. having

  What alternatives can the telephone company consider

The telephone company has a fiber-optic line with time division multiplexing. What alternatives can the telephone company consider to increase capacity?

  Design a flowchart and pseudo-code

You have a file containing the grades of students from Beginning Programming, along with students' information. Your part of the program has to loop through the records, and create sure that any student who has received a 'D', 'W', 'I', or 'F' in ..

  Explain what the database roles

Describe steps necessary to setup SQL Server security.

  Write an user defined function

Write an user defined function, that takes as input the x and y co-ordinate of three points, i.e. (x1,y1), (x2,y2) and (x3,y3). The output arguments represents the length of three side of a triangle i.e. l1,l2,l3. (25)

  Write a function to create a movie where one item is moving

Write a function to create a movie where one item is moving from the top to the bottom and another item is moving from the bottom to the top.

  Solve the single source shortest paths problem

Form graph G' from G by adding the similar positive number, p, to all of the edge weights in the graph. This positive number should be chosen so that all the edge weights in G' are positive. (p = 1 + | min edge weight in G|). Run Dijkstra's algori..

  Write a program that simulates the operation of a halloween

Write a program that simulates the operation of a Halloween Vampire Hunt game. In the game scenario, you are a vampire hunting a victim in a dark cave.

  Describe the electrical characteristics of ieee bus signals

Describe the way in which the IEEE bus can broadcast a message to several receivers, each of which operates at a different rate.

  Questionyou have been hired out as a contractor to dover

questionyou have been hired out as a contractor to dover leasing company. dover leasing is in a process of reviewing

  Find the shortest sequence of mips instructions

Find the shortest sequence of MIPS instructions that extracts bits 16 down to 11 from register $t0 and use the value of this field to replace bits 31 down to 26 in register $t1 without changing the other 26 bits of register $t1

  How would you convince users that letting the computer os

How would you convince users that letting the computer operating system or browser application remember their passwords is against good security practices?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd