Sunday 3 February 2013

Employee history in c++


//rocord of 10 employees
#include<iostream.h>
#include<stdio.h>
#include<conio.h>

class employee
{
private:
char name[40];
char address[40];
char designation[40];
int salary;

public:

void getdata()
{
cout<<"enter name  "<<endl;
gets(name);
cout<<"enter address  "<<endl;
gets(address);
cout<<"enter designation  "<<endl;
gets(designation);
cout<<"enter salary  "<<endl;
cin>>salary;
}

void displaydata()
{
cout<<"/nname is  "<<name<<endl;
cout<<"address is  "<<address<<endl;
cout<<"designation is  "<<designation<<endl;
cout<<"salary is  "<<salary<<endl;
}
};

void main()
{
employee b1,b2,b3,b4,b5,b6,b7,b8,b9,b10;
cout<<"enter details of 1st employee \n"<<endl;
b1.getdata();
cout<<"enter details of 2nd employee \n"<<endl;
b2.getdata();
cout<<"enter details of 3rd employee \n"<<endl;
b3.getdata();
cout<<"enter details of 4th employee \n"<<endl;
b4.getdata();
cout<<"enter details of 5th employee \n"<<endl;
b5.getdata();
cout<<"enter details of 6th employee \n"<<endl;
b6.getdata();
cout<<"enter details of 7th employee \n"<<endl;
b7.getdata();
cout<<"enter details of 8th employee \n"<<endl;
b8.getdata();
cout<<"enter details of 9th employee \n"<<endl;
b9.getdata();
cout<<"enter details of 10th employee \n\n\n"<<endl;
b10.getdata();
b1.displaydata();
cout<<"details of 1st employee \n"<<endl;
b2.displaydata();
cout<<"details of 2nd employee \n"<<endl;
b3.displaydata();
cout<<"details of 3rd employee \n"<<endl;
b4.displaydata();
cout<<"details of 4th employee \n"<<endl;
b5.displaydata();
cout<<"details of 5th employee \n"<<endl;
b6.displaydata();
cout<<"details of 6th employee \n"<<endl;
b7.displaydata();
cout<<"details of 7th employee \n"<<endl;
b8.displaydata();
cout<<"details of 8th employee \n"<<endl;
b9.displaydata();
cout<<"details of 9th employee \n"<<endl;
b10.displaydata();
cout<<"details of 10th employee \n"<<endl;

getch();
}






0 comments:

Post a Comment