Guest_imported
New member
- Jan 1, 1970
- 0
Please advise what this represents??
Is it polymorphism,encapsulation,default constructor stuff.
I need to know some of the names to describe this program that works.
[tt]
class Data
{
private:
int x;
protected:
int y;
public:
int z;
Data(int x=0,int y=0,int z=0);
void ShowX();
void ShowY();
void ShowZ();
virtual void All();
};
void Data::ShowX()
{
cout << x << endl;
}
void Data::ShowY()
{
cout << y << endl;
}
void Data::ShowZ()
{
cout << z << endl;
}
void Data::All()
{
cout << x << "\n" << y << "\n" << z << endl;
}
Data:ata(int x,int y,int z)
{
Data::x=x;
Data::y=y;
Data::z=z;
All();
}
class Lowerublic Data
{
public:
int d;
void ShowD();
Lower(int,int,int,int);
void All();
};
void Lower::ShowD()
{
cout << d << endl;
}
void Lower::All()
{
Data::All();
cout << d << endl;
}
Lower::Lower(int x,int y,int z,int d)ata(x,y,z)
{
d=d;
Data::All();
cout << d << endl;
}
void main()
{
Lower s1(5,4,56,7);
}[/tt]