sing an inheritance hierarchy, design a Java program to model items at a library

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Using an inheritance hierarchy, design a Java program to model items at a library (books, journal articles, videos and CDs.) It is a simplified libray system with limited functionality. Have an abstract superclass called Item and include common information that the library must have for every item (such as unique identification number, and a title). No actual objects of type Item will be created - each actual item will be an object of a (non-abstract) subclass. Place item-typespecific behavior in subclasses (such as a video's year of release, a CD's musical genre, or a book's author). A Assume that titles are unique.  Two different objects will have different titles. More in detail: 1. Implement an abstract superclass called Item and define all common operations on this class (constructors, getters, setters, borrowed, returned, toString, etc). Have private data for each item: identification number, title, whether the item is available in the library or not, and the number of available copies.  2. Implement an abstract subclass of Item named WrittenItem and define all common operations on this class. Add private data for author. 3. Implement 2 subclasses of WrittenItem: Book and JournalPaper. 3.1. Class Book: no new private data. When needed, override/overload methods from the  3.2. Class JournalPaper: add private data for year published. When needed, override/overload methods from the superclass. 4. Implement another abstract subclass of Item named MediaItem and define all common operations on this class. Add private data for runtime (double). 5. Implement 2 subclasses of MediaItem: Video and CD. 5.1. Class Video: added private data for director, genre and year released. When needed, override/overload methods from the superclass. 5.2. Class CD: added private data for artist and genre. When needed, override/overload methods from the superclass.
 
Write the definitions of these classes and a client program showing them in use. Use an ArrayList as the data structure holding the library's collection (for example, 3 books, 4 journal articles, 2 videos and 3CDs). Interact with the user by providing a menu including different options. For example: Option 1:(AddNewItem), Option 2: (BorrowItem), Option 3: (ReturnItem), Option 4: (DisplayAllLibraryItems), Option 5: (exit).
 
For instance, ask the user to indicate which option they wish to perform, they can respond by number, you read the number and ask questions to fill in the required fields. As an example, if the option is 1, then you ask information on the item to be added (book, Cd, ..), followed by questions to fill in the required fields of that item. Display the updated ArrayList after executing each option. 
 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 5 images

Blurred answer
Knowledge Booster
Introduction to Interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education