Lab Assignment No. 5
Write a program called bookstore.cpp that can read information of book, CDMusic, and DVDMovie from keyboard and then display all the information by its type: book, CDMusic, and DVDMovie.
Create a base class called Publication. The Publication class contains two member data:
* title as an array of characters
* price as float
It also contains two member functions:
* GetData() reads title and price from the keyboard.
* DisplayData() displays title and price.
Create a derived class called Book. The Book class is derived from Publication class. It contains the page_number as an ...view middle of the document...
Create a derived class called DVDMovie. The DVDMovie class is derived from Publication class. It contains the rating as an array of characters. It also contains two member functions:
* GetData() reads the rating type from the keyboard.
* DisplayData() displays the rating type.
In the main routine, the program will ask for the item type and then reads the information about each item based on selected type from the keyboard. The user may enter any order. The program will display all the information grouped by their respective type: books, CD, and DVD.
To make inheritance work properly, you must declare the objects of derived class. The member functions of derived class will activate the member functions from its base class.
Be sure to include block documentation to describe the purpose of each class and each function.
Note: In order to count for grade, you must design and use inheritance as described above.
Please use the test data below to submit your screen shots.
Title: The World War I
Title: The Four Seasons
Playing Time: 76.20 minutes
Title: A Bug’s Life
Title: The Art of French Horn
Playing Time: 69.25 minutes
Title: A History of English Speaking People
For your I/O screen shots, please show all the data you entered like my sample screen shots.
The I/O screen shots should look like the following sample: