--
#include<iostream.h>
#include<conio.h>
class media
{
public:
virtual void display()=0;
};
class book:public media
{
int bid;
char bnm[20],pub[20],auth[20];
float price;
public:
void getbook()
{
cout<<"\n Enter Book Id : ";
cin>>bid;
cout<<"\n Enter Book name : ";
cin>>bnm;
cout<<"\n Enter Publication : ";
cin>>pub;
cout<<"\n Enter Auther : ";
cin>>auth;
cout<<"\n Enter Price : ";
cin>>price;
}
void display()
{
cout<<"\n Book id : "<
cout<<"\n Book Name : "<
cout<<"\n publication : "<
cout<<"\n Auther : "<
cout<<"\n Price : "<
}
};
class cd:public media
{
char tit[20];
float cd_price;
public:
void getcd()
{
cout<<"\n Enter Cd tital : ";
cin>>tit;
cout<<"\n Enter Cd price : ";
cin>>cd_price;
}
void display()
{
cout<<"\n Cd_Tital : "<
cout<<"\n Cd_price : "<
}
};
void main()
{
clrscr();
book b;
b.getbook();
cout<<"\n-------------------------------------";
cd c;
c.getcd();
cout<<"\n-------------------------------------";
media *m;
m=&b;
m->display();
m=&c;
cout<<"\n-------------------------------------";
m->display();
getch();
}