====================================
====================================
====================================
void learning_Material::get()
{
cin>>isbn;
cin>>title;
cin>>author;
cin>>year;
}
void learning_Material::print()
{
cout<<isbn<<endl;
cout<<title<<endl;
cout<<price;
}
class book:public learning_Material
{
int pages;
public:
void get()
{
learning_Material::get();
cin>>pages;
}
void print()
{
learning_Material::print();
}
void calc_Price()
{
price=pages;
}
};
class CD:public learning_Material
{
int min;
public:
void get()
{
learning_Material::get();
cin>>min;
}
void print()
{
learning_Material::print();
}
void calc_Price()
{
price=min*2;
}
};
No comments:
Post a Comment