Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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!
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 console
It 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 tracks(int) fields
The Book class (to be modified from the assignment 2 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 are as follows:
DVD: "Title:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database In Depth Relational Theory For Practitioners

Authors: C.J. Date

1st Edition

0596100124, 978-0596100124

More Books

Students also viewed these Databases questions

Question

8. How would you explain your decisions to the city council?

Answered: 1 week ago

Question

1. Which position would you take?

Answered: 1 week ago