0% found this document useful (0 votes)
14 views5 pages

13 Ee

Uploaded by

shambhupawar293
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views5 pages

13 Ee

Uploaded by

shambhupawar293
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Sr.

no:05

[Link] Educational institute wishes to store the data of its [Link] hierarchical relationships
of its related classes are shown in the figure [Link] all the classes to represent hierarchy
and define functions to retrieve individual information as and when required.

#include<iostream.h>

#include<conio.h>

class Staff

long code;

char name[20];

public:

void input()

cout<<"\n Enter code:";

cin>>code;

cout<<"\n Enter name:";

cin>>name;

void output()

cout<<"\n Code:"<<code<<"\n Name:"<<name;

};

class Teacher: public Staff

char sub[20],publi[20];

public:

void getdata()

cout<<"\n Enter subject name:";

cin>>sub;
[Link]

cout<<"\n Enter publication:";

cin>>publi;

void putdata()

cout<<"\n Subject:"<<sub<<"\n Publi:"<<publi<<endl;

};

class Officer:public Staff

char grade;

public:

void accept()

cout<<"\n Enter grades:";

cin>>grade;

void display()

cout<<"\n Grades:"<<grade<<endl;

};

class Typist:public Staff

float speed;

public:

void accept_sp()

{
[Link]

cout<<"\n Enter speed of typing:";

cin>>speed;

void display_sp()

cout<<"\n Speed:"<<speed<<endl;

};

class Regular:public Typist

float sal;

public:

void get_sal()

cout<<"\n Enter salary:";

cin>>sal;

void put_sal()

cout<<"\n Salaray: Rs."<<sal<<endl;

};

class Casual:public Typist

int D_wages;

public:

void get_dw()

{
[Link]

cout<<"\n Enter Daily wages:";

cin>>D_wages;

void put_dw()

cout<<"\n Daily Wages: Rs."<<D_wages<<endl;

};

void main()

Teacher T;

Officer O;

Regular R;

Casual C;

[Link]();

[Link]();

[Link]();

[Link]();

[Link]();

[Link]();

[Link]();

[Link]();

R.get_sal();

R.accept_sp();

R.put_sal();

R.display_sp();

C.accept_sp();

C.get_dw();

C.display_sp();
[Link]

C.put_dw();

getch();

Output:

You might also like