Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

write class to create 10 employees

0 votes
asked Oct 12, 2019 by Tasneem Abdallah (120 points)

3 Answers

0 votes
answered Oct 13, 2019 by Abhishek Kumar
#include<iostream>

#include<conio.h>

class employee

{

int  emp_num;

char emp_name[20];

float emp_basic;

float sal;

float emp_da;

float net_sal;

float emp_it;

public:

void get_details();

void find_net_sal();

void show_emp_details();

};

'void employee::get_details()';

{

Cout<<"\nEnter employee number:\n";

cin>>emp_num;

cout<<"\nEnter employee name:\n";

cin>>emp_name;

cout<<"\nEnter employee basic:\n";

cin>>emp_basic;

}

void employee :: find_net_sal()

{

emp_da=0.52*emp_basic;

emp_it=0.30*(emp_basic+emp_da);

net_sal=(emp_basic+emp_da)-emp_it;

}

void employee :: show_emp_details()

{

cout<<"\n\n\nDetails of  :"<<emp_name;

cout<<"\n\nEmployee number:"<<emp_num;

cout<<"\nBasic salary  :"<<emp_basic;

cout<<"\nEmployee DA   :"<<emp_da;

cout<<"\nIncome Tax    :"<<emp_it;

cout<<"\nNet Salary    :"<<net_sal;

}

int main()

{

employee emp[10];

int i,num;

clrscr();

Cout<<"\nEnter number of employee details\n";

cin>>num;

for(i=0;i<num;i++)

emp[i].get_details();

for(i=0;i<num;i++)

emp[i].find_net_sal();

for(i=0;i<num;i++)

emp[i].show_emp_details();

getch();

return 0;

}
0 votes
answered Oct 14, 2019 by Prasanna Sekaran
#include<iostream.h>

#include<conio.h>

class employee

{

int   emp_num;

char  emp_name[20];

float emp_basic;

float sal;

float emp_da;

float net_sal;

float emp_it;

public:

 void get_details();

 void find_net_sal();

 void show_emp_details();

};

void employee :: get_details()

{

cout<<"\nEnter employee number:\n";

cin>>emp_num;

cout<<"\nEnter employee name:\n";

cin>>emp_name;

cout<<"\nEnter employee basic:\n";

cin>>emp_basic;

}

void employee :: find_net_sal()

{

emp_da=0.52*emp_basic;

emp_it=0.30*(emp_basic+emp_da);

net_sal=(emp_basic+emp_da)-emp_it;

}

void employee :: show_emp_details()

{

cout<<"\n\n\nDetails of   :  "<<emp_name;

cout<<"\n\nEmployee number:      "<<emp_num;

cout<<"\nBasic salary     :  "<<emp_basic;

cout<<"\nEmployee DA      :  "<<emp_da;

cout<<"\nIncome Tax       :  "<<emp_it;

cout<<"\nNet Salary       :  "<<net_sal;

}

int main()

{

employee emp[10];

int i,num;

clrscr();

cout<<"\nEnter number of employee details\n";

cin>>num;

for(i=0;i<num;i++)

 emp[i].get_details();

for(i=0;i<num;i++)

 emp[i].find_net_sal();

for(i=0;i<num;i++)

 emp[i].show_emp_details();

getch();

return 0;

}

Read more on Brainly.in - https://brainly.in/question/5503971#readmore
0 votes
answered Oct 14, 2019 by Prasanna Sekaran
#include<iostream.h>

#include<conio.h>

class employee

{

int   emp_num;

char  emp_name[20];

float emp_basic;

float sal;

float emp_da;

float net_sal;

float emp_it;

public:

 void get_details();

 void find_net_sal();

 void show_emp_details();

};

void employee :: get_details()

{

cout<<"\nEnter employee number:\n";

cin>>emp_num;

cout<<"\nEnter employee name:\n";

cin>>emp_name;

cout<<"\nEnter employee basic:\n";

cin>>emp_basic;

}

void employee :: find_net_sal()

{

emp_da=0.52*emp_basic;

emp_it=0.30*(emp_basic+emp_da);

net_sal=(emp_basic+emp_da)-emp_it;

}

void employee :: show_emp_details()

{

cout<<"\n\n\nDetails of   :  "<<emp_name;

cout<<"\n\nEmployee number:      "<<emp_num;

cout<<"\nBasic salary     :  "<<emp_basic;

cout<<"\nEmployee DA      :  "<<emp_da;

cout<<"\nIncome Tax       :  "<<emp_it;

cout<<"\nNet Salary       :  "<<net_sal;

}

int main()

{

employee emp[10];

int i,num;

clrscr();

cout<<"\nEnter number of employee details\n";

cin>>num;

for(i=0;i<num;i++)

 emp[i].get_details();

for(i=0;i<num;i++)

 emp[i].find_net_sal();

for(i=0;i<num;i++)

 emp[i].show_emp_details();

getch();

return 0;

}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...