Question: Create as well as implement a Java program that does the following: A) Media hierarchy: Create Media, EBook, MovieDVD, and MusicCD Add an attribute
Create as well as implement a Java program that does the following: A) Media hierarchy: Create Media, EBook, MovieDVD, and MusicCD Add an attribute to Media class to store indication when media object is rented versus available. Add code to constructor and create get and set methods as appropriate. Add any additional constructors and methods needed to support the below functionality B) Create as well as implement a Manager class that does the following: stores a list of Media objects has functionality to load Media objects from files creates/updates Media files has functionality to add new Media object to its Media list has functionality to find all media objects for a specific title and returns that list has functionality to rent Media based on id (updates rental status on media, updates file, returns rental fee) C) Create as well as implement MediaRental System which has the following functionality: user interface which is either menu driven through console commands or GUI buttons or menus. Look at the bottom of this project file for sample look and feel. selection to load Media files from a given directory (user supplies directory) selection to find a media object for a specific title value (user supplies title and should display to user the media information once it finds it - should find all media with that title) selection to rent a media object based on its id value (user supplies id and should display rental fee value to the user) selection to exit program D) The Program should throw and catch Java built-in and user-defined exceptions as appropriate E) Your classes must be coded with correct encapsulation: private/protected attributes, get methods, and set methods and value validation F) There should be appropriate polymorphism: overloading, overriding methods, and dynamic binding G) Program should take advantage of the inheritance properties as appropriate Sample User interface - command driven: Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 1 Enter path (directory) where to load from: blah File cannot be opened: Could not load, no such directory Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 1 Enter path (directory) where to load from: C:/tmp-umuc Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 2 Enter the title: blah There is no media with this title: blah Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 2 Enter the title: Forever Young EBook [id=123, title=Forever Young, year=2018, chapters=20 available=true] MovieDVD [id=126, title=Forever Young, year=2020, size=140.0MB available=false] Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 3 Enter the id: 123 Media was successfully rented. Rental fee = $2.00 Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 2 Enter the title: Forever Young EBook [id=123, title=Forever Young, year=2018, chapters=20 available=false] MovieDVD [id=126, title-Forever Young, year-2020, size=140.0MB available=false] Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 3 Enter the id: 999 The media object id=999 is not found Welcome to Media Rental System 1: Load Media objects... 2: Find Media object.... 3: Rent Media object... 9: Quit Enter your selection : 9 Thank you for using the program. Goodbye! Sample User interface - GUI: Menu Welcome to Media Rental System Menu Load Media objects... Find Media object... Rent Media object... Quit Welcome to Media Rental System Open 7 Look In: 100 Windows (C:) $GetCurrent Brother cygwin Intel MSOCache PerfLogs Program Files Program Files (x86) | ProgramData Python27 Python36 Python37 sr tmp-umuc Folder name: C:\tmp-umuc Files of Type: All Files Users usr T E 01 Windows Windows.old Windows 10Upgrade Open 0 X 19 Cancel Enter your selection : 2 Enter the title: Forever Young EBook [id=123, title=Forever Young, year=2018, chapters=20 available=true] MovieDVD [id=126, title=Forever Young, year=2020, size=140.0MB available=false] Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 3 Enter the id: 123 Media was successfully rented. Rental fee = $2.00 Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 2 Enter the title: Forever Young EBook [id=123, title=Forever Young, year=2018, chapters=20 available=false] MovieDVD [id=126, title=Forever Young, year=2020, size=140.0MB available=false] Welcome to Media Rental System 1: Load Media objects... 2: Find Media object.... 3: Rent Media object... 9: Quit Enter your selection : 3 Enter the id: 999 The media object id=999 is not found Welcome to Media Rental System 1: Load Media objects... 2: Find Media object.... 3: Rent Media object.... 9: Quit Enter your selection : 9 Thank you for using the program. Goodbye! Sample User interface - GUI: Menu Welcome to Media Rental System Menu Load Media objects... Find Media object... Rent Media object... Quit Welcome to Media Rental System Open 7 Look In: 100 Windows (C:) $GetCurrent Brother cygwin Intel MSOCache PerfLogs Program Files Program Files (x86) | ProgramData Python27 Python36 Python37 sr tmp-umuc Folder name: C:\tmp-umuc Files of Type: All Files Users usr T E 01 Windows Windows.old Windows 10Upgrade Open 0 X 19 Cancel Welcome to Media Rental System Menu Load Media objects... Find Media object... Rent Media object... Quit Welcome to Media Rental System Input ? Menu Menu Enter the title blah Welcome to Media Rental System Message Menu Welcome to Media Rental System Input ? OK Enter the title Forever Young OK Cancel There is no media with this title: blah I Cancel U X X U X X X X Message ( Welcome to Media Rental System Welcome to Media Rental System Menu Load Media objects... Find Media object... Rent Media object... Quit Menu Welcome to Media Rental System Input ? EBook [id=123, title=Forever Young, year=2018, chapters=20 available=true] MovieDVD [id=126, title=Forever Young, year-2020, size=140.0MB available=false] Menu Enter the id 123 OK Welcome to Media Rental System Cancel OK X JX Message i Media was successfully rented. Rental fee = $2.00 X X X X Welcome to Media Rental System Input Menu Message i Input ? Enter the title Forever Young Menu OK Welcome to Media Rental System Enter the title Forever Young OK Cancel Cancel EBook [id=123, title=Forever Young, year=2018, chapters=20 available=false] MovieDVD [id=126, title=Forever Young, year-2020, size=140.0MB available=false] OK Welcome to Media Rental System Message i Invalid title value Above closed the window by pressing the X, results in below: 0 X HAR RUNTUN X ZIEME X Create as well as implement a Java program that does the following: A) Media hierarchy: Create Media, EBook, MovieDVD, and MusicCD Add an attribute to Media class to store indication when media object is rented versus available. Add code to constructor and create get and set methods as appropriate. Add any additional constructors and methods needed to support the below functionality B) Create as well as implement a Manager class that does the following: stores a list of Media objects has functionality to load Media objects from files creates/updates Media files has functionality to add new Media object to its Media list has functionality to find all media objects for a specific title and returns that list has functionality to rent Media based on id (updates rental status on media, updates file, returns rental fee) C) Create as well as implement MediaRentalSystem which has the following functionality: user interface which is either menu driven through console commands or GUI buttons or menus. Look at the bottom of this project file for sample look and feel. selection to load Media files from a given directory (user supplies directory) selection to find a media object for a specific title value (user supplies title and should display to user the media information once it finds it should find all media with that title) selection to rent a media object based on its id value (user supplies id and should display rental fee value to the user) selection to exit program D) The Program should throw and catch Java built-in and user-defined exceptions as appropriate E) Your classes must be coded with correct encapsulation: private/protected attributes, get methods, and set methods and value validation F) There should be appropriate polymorphism: overloading, overriding methods, and dynamic binding G) Program should take advantage of the inheritance properties as appropriate Sample User interface - command driven: Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 1 Enter path (directory) where to load from: blah File cannot be opened: Could not load, no such directory Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 1 Enter path (directory) where to load from: C:/tmp-umuc Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 2 Enter the title: blah There is no media with this title: blah Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 2 Enter the title: Forever Young EBook [id=123, title=Forever Young, year=2018, chapters=20 available=true] MovieDVD [id=126, title=Forever Young, year=2020, size=140.0MB available=false] Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 3 Enter the id: 123 Media was successfully rented. Rental fee = $2.00 Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 2 Enter the title: Forever Young EBook [id=123, title=Forever Young, year-2018, chapters=20 available=false] MovieDVD [id=126, title=Forever Young, year=2020, size=140.0MB available=false] Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 3 Enter the id: 999 The media object id=999 is not found Welcome to Media Rental System 1: Load Media objects... 2: Find Media object.... 3: Rent Media object.... 9: Quit Enter your selection : 9 Thank you for using the program. Goodbye! Sample User interface - GUI: Menu Welcome to Media Rental System Menu Load Media objects... Find Media object... Rent Media object... Quit Welcome to Media Rental System Open 7 Look In: 100 Windows (C:) $GetCurrent Brother cygwin Intel MSOCache PerfLogs Program Files Program Files (x86) | ProgramData Python27 Python36 Python37 sr tmp-umuc Folder name: C:\tmp-umuc Files of Type: All Files Users usr T E 01 Windows Windows.old Windows 10Upgrade Open 0 X 19 Cancel Enter your selection : 2 Enter the title: Forever Young EBook [id=123, title-Forever Young, year=2018, chapters=20 available=true] MovieDVD [id=126, title=Forever Young, year=2020, size=140.0MB available=false] Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 3 Enter the id: 123 Media was successfully rented. Rental fee = $2.00 Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 2 Enter the title: Forever Young EBook [id=123, title=Forever Young, year=2018, chapters=20 available=false] MovieDVD [id=126, title=Forever Young, year=2020, size=140.0MB available=false] Welcome to Media Rental System 1: Load Media objects... 2: Find Media object... 3: Rent Media object... 9: Quit Enter your selection : 3 Enter the id: 999 The media object id=999 is not found Welcome to Media Rental System 1: Load Media objects... 2: Find Media object.... 3: Rent Media object... 9: Quit Enter your selection : 9 Thank you for using the program. Goodbye! Sample User interface - GUI: Menu Welcome to Media Rental System Menu Load Media objects... Find Media object... Rent Media object... Quit Welcome to Media Rental System Open 7 Look In: 100 Windows (C:) $GetCurrent Brother cygwin Intel MSOCache PerfLogs Program Files Program Files (x86) | ProgramData Python27 Python36 Python37 sr tmp-umuc Folder name: C:\mp-umuc Files of Type: All Files Users usr T E 01 Windows Windows.old Windows 10Upgrade Open 0 X 19 Cancel Welcome to Media Rental System Menu Load Media objects... Find Media object... Rent Media object... Quit Welcome to Media Rental System Input ? Menu Menu Enter the title blah Welcome to Media Rental System Message Menu Welcome to Media Rental System Input ? OK Enter the title Forever Young OK Cancel There is no media with this title: blah I Cancel U X X U X X X X Message ( Welcome to Media Rental System Welcome to Media Rental System Menu Load Media objects... Find Media object... Rent Media object... Quit Menu Welcome to Media Rental System Input ? EBook [id=123, title=Forever Young, year-2018, chapters-20 available=true] MovieDVD [id=126, title=Forever Young, year-2020,size=140.0MB available=false] Menu Enter the id 123 OK Welcome to Media Rental System Cancel OK X JX Message i Media was successfully rented. Rental fee = $2.00 X X X X Welcome to Media Rental System Input Menu Message i Input ? Enter the title Forever Young Menu OK Welcome to Media Rental System Enter the title Forever Young OK Cancel Cancel EBook [id=123, title=Forever Young, year-2018, chapters=20 available=false] MovieDVD [id=126, title=Forever Young, year-2020, size=140.0MB available=false] OK Welcome to Media Rental System Message i Invalid title value Above closed the window by pressing the X, results in below: 0 X HAR RUNTunt X ZIEME X
Step by Step Solution
3.48 Rating (155 Votes )
There are 3 Steps involved in it
SOLUTION I have solve the problem in Java code with comments and screenshot for easy understanding CODE import javaioFile import javaioFileNotFoundException import javautilArrayList import javautilLis... View full answer
Get step-by-step solutions from verified subject matter experts
