0% found this document useful (0 votes)
41 views4 pages

Employee Management

The document defines classes for an employee, student, manager, worker and scientist. It has methods to read and display data for each class. At the end it creates a scientist object and calls its methods to read and display data.

Uploaded by

hhumas
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views4 pages

Employee Management

The document defines classes for an employee, student, manager, worker and scientist. It has methods to read and display data for each class. At the end it creates a scientist object and calls its methods to read and display data.

Uploaded by

hhumas
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

#include<iostream.

h>
#include<string.h>
#define MAX 30
class emp
{
protected:
int emp_id;
char emp_name[MAX];
public:
emp(int n1,char n2[MAX]){
emp_id=n1;
strcpy(emp_name,n2[MAX]);
}
void set_data()
{
cout<<"++++++++++++++++++++++++++++<<IN PUT SCREEN>>++++++++++++++++++++
+++++++++++++"<<endl;
cout<<"enter employee id :";
cin>>emp_id;
cout<<"ENter emplyee name:";
cin.ignore(10,'\n');
cin.get(emp_name,MAX);
}
void disp_data()
{
cout<<"Employee id is ="<<emp_id<<endl
<<"EMploye name is ="<<emp_name;
cout<<endl;
}
};
////////////////////////////////////////////////////////////////////////////////
/////////////////////////
class Student
{
protected:
char last_degree[MAX],degree_progress[MAX];
public:
Student(int n1,char n2[MAX]){
emp_id=n1;
strcpy(emp_name,n2[MAX]);
}
void get_dataST()
{
cout<<"\nEnter last degree:";
cin.ignore(MAX,'\n');
cin.get(last_degree,MAX);

cout<<"\nEnter current degree:";


cin.ignore(MAX,'\n');
cin.get(degree_progress,MAX);
}
void disp_dataST()
{
cout<<"Student last degree:"<<last_degree<<"Student current degree:"<<de
gree_progress;
cout<<endl;
}
};
////////////////////////////////////////////////////////////////////////////////
/////////////////////////
class manager :public emp,public Student
{
char designation[MAX];
float club_dues;
public:

void read_dataM()
{
set_data();
cin.ignore(MAX,'\n');
cout<<"enter Section=";
cin>>designation;
cout<<endl;
cout<<"enter Club dues=";
cin>>club_dues;
}
void disp_dataM()
{
cout<<"++++++++++++++++++++++++++++<<OUT PUT SCREEN>>+++++++++++
++++++++++++++++++++++"<<endl;
disp_data();
cout<<"Manager designation is :="<<designation;
cout<<endl;
cout<<"Manager club dues are :="<<club_dues<<endl;
cout<<"++++++++++++++++++++++++++++<<<<<<<<<THE END>>>>>>+++++++
+++++++++++++++++++++++"<<endl;
}
};
////////////////////////////////////////////////////////////////////////////////
///////////////////

class workers :public emp


{
int shift_number;
float daily_wages;
public:
void read_dataW()
{
set_data();
cout<<"Labour enter shift number=";
cin>>shift_number;
cout<<endl;
cout<<"Labour enter Wages=";
cin>>daily_wages;
}
void disp_dataW()
{
cout<<"++++++++++++++++++++++++++++<<OUT PUT SCREEN>>+++++++++++
++++++++++++++++++++++"<<endl;
disp_data();
cout<<"Labour shift no is :="<<shift_number;
cout<<endl;
cout<<"Labour wages are :="<<daily_wages<<endl;
cout<<"++++++++++++++++++++++++++++<<<<<<<<<THE END>>>>>>+++++++
+++++++++++++++++++++++"<<endl;
}
};
////////////////////////////////////////////////////////////////////////////////
////////////////////////
class scientist :public emp,Student
{
private:
char field[MAX],n_pub[MAX];
public:
void get_dataS()
{
set_data();
get_dataST();
cout<<"\nEnter scientist Field :";
cin.ignore(MAX,'\n');
cin.get(field,MAX);
cout<<"\nEnter Publications:";
cin.ignore(MAX,'\n');
cin.get(n_pub,MAX);
}
void disp_dataS()
{
disp_data();

disp_dataST();
cout<<"\nScientist Field:"<<field<<endl;
cout<<"\nScientist Publications:"<<n_pub<<endl;
}
};
////////////////////////////////////////////////////////////////////////////////
////////////////////////
int main()
{
scientist s1;
s1.get_dataS();
s1.disp_dataS();
return 0;
}

You might also like