#include
#include
#include
const int max =100 ;
class pub
{
protected :
char title[max];
float price;
public :
getdata(){cout<<"Enter title name : " ;cin>>title;
cout<<"\nenter price: ";cin>>price;}
showdata(){cout<<"***************\nTitle name: "<
};
class sales
{
protected:
float month[3];
public:
getsales(){for (int j=0;j<3;j++)
{cout<<"Enter sales amount for month "< cin>>month[j];}} showsales(){for (int j=0;j<3;j++) {cout<<"sales amount for month "< }; class book:public pub,public sales { protected : int page; public : getdata(){pub::getdata(); cout<<"\nenter number of pages : ";cin>>page;sales::getsales();} showdata(){pub::showdata();cout<<"\nNumber of pages : "< sales::showsales();cout<<"\n***************\n";} } ; class tape:public pub, public sales { protected: float tapelong; public: getdata(){pub::getdata();cout<<"Enter tape long: ";cin>>tapelong;sales::getsales();} showdata(){pub::showdata();cout<<"\ntape long : "< sales::showsales();cout<<"\n*****************"< }; void main() { book *book1[100]; tape *tape1[100]; int x,y,t,num=0,i,tempy=0,tempt=0; char w; while(num != 5) { cout<<"\nPress:\n1.store book\n2.store tape\n3.show book\n4.show tape\n5.EXIT\n"; cin>>x; switch(x) { case 1 :do { static y=0; book1[y]=new book; book1[y]->getdata(); y++; cout<<"another entrey ?(Y or N)\n"; cin>>w; tempy=y; }while(w=='y'); break; case 2:do {static t=0; tape1[t]=new tape; tape1[t]->getdata(); t++; cout<<"another entrey ?(Y or N)\n"; cin>>w; tempt=t; }while(w=='y'); break; case 3:for(i=0;i book1[i]->showdata(); break; case 4:for(i=0;i tape1[i]->showdata(); break; case 5: num=5;break; default : cout<<"Enter right number\n"; } } }