11/5/2011, 08:56
#include
#include
#include
class ve
{
public:
double giagoc;
char ngay[30];
char dcxp[50];
char tp[40];
char tl[30];
char tnsx[50];
void nhap()
{
cout<<"\n gia ve goc: "<
cout<<"\n ngay chieu phim: ";
gets(ngay);fflush(stdin);
cout<<"\n dia chi rap chieu phim: ";
gets(dcxp);fflush(stdin);
cout<<"\n ten phim: ";
gets(tp);fflush(stdin);
cout<<"\n the loai phim: ";
gets(tl);fflush(stdin);
cout<<"\n nuoc san xuat phim: ";
gets(tnsx);fflush(stdin);
}
void xuat()
{
cout<<"\n gia ve goc: "<
};
class veNL:public ve
{
float mgg1;
double giave1;
public:
void nhap1();
double tgg1();
void xuat1();
};
class veTE:public ve
{
float mgg2;
double giave2;
public:
void nhap2();
double tgg2();
void xuat2();
};
void veNL::nhap1()
{
ve::nhap();
cout<<"\n gia ve: ";
cin>>giave1;
cout<<"\n muc giam gia: ";
cin>>mgg1;
}
double veNL::tgg1()
{
return (giave1*mgg1)/100;
}
void veNL::xuat1()
{
ve::xuat();
cout<<"\n gia ve: "<
void veTE::nhap2()
{
ve::nhap();
cout<<"\n gia ve: ";
cin>>giave2;
cout<<"\n muc giam gia: ";
cin>>mgg2;
}
double veTE::tgg2()
{
return (giave2*mgg2)/100;
}
void veTE::xuat2()
{
ve::xuat();
cout<<"\n gia ve: "<
void main()
{
clrscr();
veNL a;
cout<<"\n thong tin ve nguoi lon:"<
a.nhap1();
a.xuat1();
cout<<"\n gia ve sau khi dc giam gia: "<
cout<<"\n thong tin ve tre em: "<
b.nhap2();
b.xuat2();
cout<<"\n gia ve sau khi dc giam gia: "<
}