#include <iostream>
using namespace std;
int health=200;tax=300;
class employee
{
int id,basic,hra,da,gp,np,ded;
char name[20];
public:
void input();
void grosspay();
void netay();
void output();
};
void employee::input()
{
cout<<"Enter Employee ID:";
cin>>id;
cout<<"\n Enter Employee Name:";
cin>>name;
cout<<"\n Enter Basic & Salary:";
cout>>basic;
cout<<"\n Enter HRA:";
cin>>hra;
cout<<"\n Enter DA:";
cin>>da;
}
void employee::grosspay()
{
gp=basic+hra+da;
}
void employee::netpay()
{
ded=health+tax;
np=gp-ded;
}
void employee::display()
{
cout<<"\n"<<name<<"\t\t"<<id<<"\t\t"<<basic<<"\t\t"<<da<<"\t\t"<<hra<<"\t"<<gp<<"\t\t"<<np<<"\t\t";
}
int main()
{
int n,i;
employee e[20];
cout<<"Enter the no.of employees:";
cin>>n;
for(i;i<n;i++)
{
e[i].input();
e[i].grosspay();
e[i]i.netpay();
}
cout<<\ Employee Name \t Employee Id\Basic Salary\tDA\tHRA\t Grosspay\tNetpay;
for(i=0;i<n;i++)
{
e[i].display();
return 0;
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: