Question: Java Assignment Instructions: Create an Abstract Class - MediaItem: Fields: title, author, ISBN, publicationYearMethods: Constructor for initializing fields. An abstract method displayInfo ( ) .
Java Assignment Instructions:
Create an Abstract Class MediaItem:
Fields: title, author, ISBN, publicationYearMethods:
Constructor for initializing fields. An abstract method displayInfoStandard getter and setter methods.
Create Subclasses for Different Media Types:
Book Class: Inherits from MediaItem
Additional Fields: genre, pageCountImplement displayInfo to print all fields, including the type "Book."
Magazine Class: Inherits from MediaItem
Additional Fields: issueNumber, monthlyEditionImplement displayInfo to print all fields, including the type "Magazine."
EBook Class: Inherits from MediaItem
Additional Fields: fileSizeMB, fileFormatImplement displayInfo to print all fields, including the type EBook."
File IO Saving and Loading Media Items:
Write a method saveToFileString filename to save the list of MediaItem objects to a text file. The file should include details of each item, distinguishing each type of media. Write a method loadFromFileString filename to read and create MediaItem objects from a file. Implement exception handling to manage issues like missing files or incorrect formatting.
Exception Handling:
Create a custom exception class InvalidMediaFormatException. Throw this exception if the data format read from the file does not match the expected structure. Handle standard exceptions, such as FileNotFoundException and IOException, within loadFromFile.
Main Application Class LibraryManager:
Menu Options:
Add a new media item book magazine, or ebookDisplay all media items.Save media items to a file.Load media items from a file.
Search Functionality:
Add a method to search for items by title or author using String.contains to locate partial matches.
String Manipulation and Formatting:
Implement methods for string manipulation, such as formatting output in displayInfo and ensuring consistent data entry formats eg capitalizing titles
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
