Posts

Showing posts from May, 2020

Imagine a publishing company which does marketing for book and audiocassette versions. Create a class publication that stores the title (a string) and price (type float) of a publication. From this class derive two classes: book, which adds a page count (type int), and tape, which adds a playing time in minutes (type float). Write a program that instantiates the book and tape classes, allows user to enter data and displays the data members.

Image
Imagine a publishing company which does marketing for book and audiocassette versions. Create a class publication that stores the title (a string) and price (type float) of a publication. From this class derive two classes: book, which adds a page count (type int), and tape, which adds a playing time in minutes (type float). Write a program that instantiates the book and tape classes, allows user to enter data and displays the data members. OUTPUT OF THE PROGRAM #include<iostream> using namespace std; class publication {                 char title[10];                float price;        public:             void read()             {                 cout<<"\nEnter Title of the Publication :";                 cin>>title;                 cout<<"\nEnter the price of Publication :";                 cin>>price;             }            void show()             {                 cout<<"Title is :"<<title<<"\n&quo