#include<iostream.h>
#include<conio.h>
class employee
{
protected:
int emp_code;
public:
employee();
void display();
};
class
faculty:public virtual employee
{
protected:
char sub[10];
public:
faculty();
void display();
class lab_staff:public
virtual employee
{
protected:
float lb;
public:
lab_staff();
void display();
};
class
instructor:public faculty,public lab_staff
{
public:
instructor();
void display();
};
void main()
{
instructor inst1;
inst1.display();
getch();
}
void
employee::employee()
{
cout<<"start"<<endl;
cin>>emp_code;
}
void
employee::display()
{
cout<<"emp_code
is"<<emp_code;
}
void
faculty::faculty()
{
cin>>sub;
}
void
faculty::display()
{
employee::display();
}
void
lab_staff::lab_staff()
{
cin>>lb;
}
void
lab_staff::display()
{
employee::display();
}
void
instructor::instructor()
{
}
void
instructor::display()
{cout<<emp_code;
cout<<sub;
cout<<lb;
}
0 comments:
Post a Comment