//program for salary payroll
#include<iostream.h>
#include<stdlib.h>
class employee
{
    char name[50];
    int number,worked_hours,PF,HRA,salary,net_salary;
public:
    void read();
        void calculate();
        void display();
};
void employee::read()
{
    cout<<"enter the employee details here";
    cout<<"\n enter the employee name";
    cin>>name;
    cout<<"\n emter the employee number";
    cin>>number;
    cout<<"\n enter the employee worked hour";
    cin>>worked_hours;
    cout<<"\n enter the employee PF";
    cin>>PF;
    cout<<"\n enter the employee HRA";
    cin>>HRA;

}
void employee::calculate()
{
    salary=worked_hours*100;
    net_salary=salary-PF-HRA;
}
void employee::display()
{
    cout<<"\t\n"<<name;
    cout<<"\t\n"<<number;
    cout<<"\t\n"<<worked_hours;
    cout<<"\t\n"<<PF;
    cout<<"\t\n"<<HRA;
    cout<<"\t\n"<<salary;
    cout<<"\t\n"<<net_salary<<"\n";
    system("pause");
}
void main()
{
    employee payroll[3];
        int i;

    for(i=0;i<3;i++)
    {
        payroll[i].read();
        payroll[i].calculate();
    }
    cout<<"\n____________________________________________________________";
    cout<<"\n\n\t\t\tSALARY DETAILS";
    cout<<"\n____________________________________________________________\n";
    cout<<"\nname\tnumber\tworked hours\tPF\tHRA\tsalary\tnet_salary";
    cout<<"\n____________________________________________________________";

        for(i=0;i<3;i++)
        {
            payroll[i].display();

}
        cout<<"\n\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\n\t";
}

Edited 3 Years Ago by Reverend Jim: Fixed formatting

Sorry my friend, you are in the wrong forum...

Looks like PHP??? not sure. Try a different forum, I'm sure someone will help there. Good luck.

This article has been dead for over six months. Start a new discussion instead.