Problem to solve:
Assume you have to write software to be used by a university library. There are three types of item that can be borrowed from the library - DVDs, books and journals. These are all a type of Media.
You will need to create a simple hierarchy for items that the library lends out. Create a Media base class with DVD, Book and Journal as derived classes as shown in the UML diagram.
Requirements:
The member variables (id, title, year) in the Media class should be private. Each class should have appropriate constructor(s).