Sunday, 15 June 2014

C++ program to calculate Gross and net salary of an employee



Here is a C++ pprogram to calculate Gross and net salary of an employee


 SOURCE CODE OUTPUT
#include <iostream>
using namespace std;
int main()
{
    float basic, hra, da, ma, pf, insurance, net, gross;
    cout<<"Enter your basic salary:";
    cin>>basic;
    cout<<"House Rent Allowance: ";
    cin>>hra;
    cout<<"Dearness Allowance:";
    cin>>da;
    cout<<"Medical Allowance:";
    cin>>ma;
    cout<<"Provident Fund and Insurance amount:";
    cin>>pf>>insurance;
    gross = basic + (hra * basic) / 100 + (da * basic) / 100;
    gross = gross + (ma * basic) / 100;
    net = gross - (pf + insurance);
    cout<<"\nGross Salary: "<<gross<<" Rupees"<<endl;
    cout<<"Net Salary:   "<<net<<" Rupees"<<endl<<endl;
    return 0;
}


Any questions regarding to program please write in comments.

1 comment:

  1. Given payable tax is 3% of gross pay greater than 2000shillings ,write a c++program that will compute net salary for a person who earns more than and less than 2000shillings

    ReplyDelete