A c++ program to compute the net salary of an employee with the following
Basic salary
Transport allowance 15% from the basic salary
Housing allowance is 8% from the basic salary
if the basic salary is more than 500 then,
the launch allowance is 5% of the basic salary. Gross allowance is equal to basic salary, transport allowance and housing allowance
tax is 6%
Total deduction is Gross allowance minus tax
Net Salary is?
#include <iostream>
using namespace std;
int main()
{
int basic_salary;
cout<<"\nEnter basic salary: ";
cin>>basic_salary;
int transport_allowance=0.15*basic_salary;
int housing_allowance=0.08*basic_salary;
int launch_allowance;
int gross_allowance;
int transport_allowance_tax;
int housing_allowance_tax;
int net_salary=basic_salary+transport_allowance+housing_allowance;
if (basic_salary>500){
launch_allowance=0.05*basic_salary;
gross_allowance=basic_salary;
transport_allowance_tax=0.06*transport_allowance;
housing_allowance_tax=0.06*housing_allowance;
net_salary=basic_salary+housing_allowance+transport_allowance+launch_allowance-(transport_allowance_tax+housing_allowance_tax);
}
cout<<"\nNet salary = "<<net_salary;
return 0;
}
Comments
Dear Bismark, please pay attention the code works well
The codes didn't work out. At the of the codes. At the the Net salary wasn't calculated.
Leave a comment