0

Create a class; employee with 22 employees (permanent, temporaly)
Class members: First name, IDno, Age, Depertment, salary,No of days, Gender, Marital status.
Class function members are: capturenewemployee(), Displayemployeedetails(), Searchemployee().

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by yuvaraj.tr
0

hi try this one
#include<iostream>
using namespace std;
class employee
{
int Id_no,No_days,age;
float salary;
char first_name[5],depat[5],gen[4],material[6];
public:
void capturenewemployee();
void employeedetails();
void searchemployee();
};
void employee :: capturenewemployee(void)
{
cout << "enter the firstname" << "\n" ;
cin >> first_name ;
cout << " enter age " << "\n" ;
cin >> age;
cout << " enter the Id_no" << "\n" ;
cin >> Id_no ;
cout << " enter the department " << "\n" ;
cin >> depat ;
cout <<" enter the gender" << "\n" ;
cin >> gen ;
cout << " enter material status" << "\n" ;
cin >> material ;
cout << " enter the No_days " << "\n" ;
cin >> No_days;
cout << " enter the salary" << "\n";
cin >> salary ;
}
void employee :: employeedetails(void)
{
cout <<" display result" << "\n";
cout << first_name << "\n";
cout << age << "\n";
cout << Id_no << "\n";
cout << depat << "\n";
cout << gen << "\n";
cout << material << "\n";
cout << No_days << "\n";
cout << salary << "\n";
}
void employee :: searchemployee(void)
{
cout <<" search result"<< "\n";
cout << first_name << "\n";
cout << age << "\n";
cout << Id_no << "\n";
cout << depat << "\n";
cout << gen << "\n";
cout << material << "\n";
cout << No_days << "\n";
cout << salary << "\n";
}
int main()
{
employee ne[10],ol[10];int i;

for(i=0;i<3;i++)
{
cout <<"enter employee details" << "\n";
ne.capturenewemployee();
}
ne[0].employeedetails();
ne[2].searchemployee();
return 0;
}

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.