Question Description
Using an inheritance hierarchy, design a Java program tomodel items at a library (books, journal articles, videos and CDs.) Have anabstract superclass called Itemand include common information that the library must have for every item (suchas unique identification number, title, and number of copies). No actualobjects of type Itemwill be created each actual item will be an object of a (nonabstract)subclass. Place itemtypespecific behavior in subclasses (such as a video'syear of release, a CD's musical genre, or a book's author). More in detail:
1.Implement an abstract superclass called Item and define all commonoperations on this class
(constructors, getters, setters, equals, toString, print, checkIn, checkOut, addItem, etc). Have private datafor: identification number, title, and number of copies.
2.Implement an abstract subclass of Item named WrittenItemand define all common operations on thisclass. Added private data for author.
3.Implement 2 subclasses of WrittenItem: Book and JournalPaper.
3.1.Class Book: no newprivate data. When needed, override/overload methods from the superclass.
3.2.Class JournalPaper: addedprivate data for year published. When needed, override/overload methods fromthe superclass.
4.Implement another abstract subclass of Item named MediaItem anddefine all common operations on this class. Added private data for runtime (integer).
5.Implement 2 subclasses of MediaItem: Video and CD.
5.1.Class Video: addedprivate data for director, genre and year released. When needed,override/overload methods from the superclass.
5.2.Class CD: added privatedata for artist and genre. When needed, override/overload methods from thesuperclass.
Write the definitions of these classes and a client program(your choice!) showing them in use. Some possible output could look like this:
Displayinfo about a book
ID:123456
TITLE:To kill a mocking bird
AUTHOR:Harper Lee
NUMBEROF COPIES: 5
Afterthe book was checkedout, the number of copies changed. The new info is:Display infoabout a book
ID:123456
TITLE:To kill a mocking bird
AUTHOR: Harper Lee NUMBER OF COPIES: 4
Aftera new copy of this book was added, the number of copies changed. The new infois:
Displayinfo about a book
ID:123456
TITLE:To kill a mocking bird
AUTHOR:Harper Lee
NUMBEROF COPIES: 5
Displayinfo about a video
ID:1111
TITLE:The Godfather
DIRECTOR:Francis Ford Coppola
GENRE:drama
YEARRELEASED: 1981
RUNTIME:215.0 minutes
NUMBEROF COPIES: 3
Afterthe video was checkedin, the number of copies changed. The new info is:
Displayinfo about a video
ID:1111
TITLE:The Godfather
DIRECTOR:Francis Ford Coppola
GENRE:drama
YEARRELEASED: 1981
RUNTIME: 215 minutes NUMBER OF COPIES: 4
…
…
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Writedemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Place Order” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.