Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In assignment 2 , you made a library management system that was used to manage the library's collection of books. However, the library would now
In assignment you made a library management system that was used to manage the library's collection of books. However, the library would now like to upgrade its system to allow for other media items, like movies and music albums, to exist inside of the library and be available for checkout!
Your task is to create a class, MediaItem, to act as a base class for all media items in the library that encapsulates the fields and behaviors that are general to all media item types and to create two new classes, DVD and VinylRecord, that inherit from MediaItem alongside Book.
The MediaItem class:
Should encapsulate the title and availability fields
Should have a constructor that initializes all fields
Should have the appropriate accessor methods for all fields
Should have mutators concerned solely with updating a MediaItem's availability: CheckoutMediaItem and ReturnMediaItem
Should not have a mutator for title, title should be set upon creation only using the constructor.
Should have a virtual void method named DisplayInfo that has no parameters and prints out the title and the availability to the consoleIt should be in the following format: "Title: Availability:
The DVD class:
Should encapsulate the director and release year fields both strings
The VinylRecord class:
Should encapsulate the artist string and number of tracksint fields
The Book class to be modified from the assignment implementation:
Should now encapsulate only the author and ISBN fields
The DVD VinylRecord and Book classes should:
Inherit from MediaItem
Have a constructor that initializes all fields, now with proper delegation to the base class's constructor for fields of the base class
Have appropriate accessor methods for all fields exclusive to their respective classes
Not have mutators for their exclusive fields. These fields should be set upon creation only using the constructor
Override the DisplayInfo method and print out information that is specific to the derived class in question.
The formats for DisplayInfo's output are as follows:
DVD: "Title:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started