#include <iostream.h>
class employee
{
char firstName[50];
char lastName[50];
int salary;
public:
employee()
{
strcpy(firstName, "NULL");
strcpy(lastName, "NULL");
salary=0;
}
void setfn()
{
cout<<"Enter First Name of Emplyee: ";
cin>>firstName;
}
void setln()
{
char ln;
cout<<"Enter Last Name of Emplyee: ";
cin>>lastName;
}
void sets()
{
int s;
cout<<"Enter salary of "<<firstName<<" "<<lastName<<": ";
cin>>s;
if(s<0){s=0;}
salary=s;
}
void dfn()
{
cout<<"First Name is: "<<firstName<<endl;
}
void dln()
{
cout<<"Last Name is: "<<lastName<<endl;
}
void dsalary()
{
cout<<"Salary of "<<firstName<<" "<<lastName<<" of one year is: "<<salary*12<<endl;
cout<<"Salary with 10% of "<<firstName<<" "<<lastName<<" is: "<<((salary*10)/100)+salary<<endl;
}
};
int main()
{
char a;
employee e1;
again:
e1.setfn();
e1.setln();
e1.sets();
e1.dfn();
e1.dln();
e1.dsalary();
cout<<"Would you like to put data of new employee: ";
cin>>a;
if(a=='y' || a=='Y'){goto again;}
}