write a simple program in c++ to calculate the salary of an employee where by the basic salary will be entered by the user and other allowance as constant.
The following are the other allowance
1. dressing allowance 30% of basic
2. Fuel allowance 20% of basic
3. Maintenance allowance 30% of basic
4. SSNIT allowance 10% of basic
5. Rent allowance 40% of basic
Calculate your gross salary
#include<iostream>
using namespace std;
int main(){
cout<<"Enter the basic salary\n";
double salary;
cin>>salary;
double dressing_allowance = 0.3 * salary;
double fuel_allowance = 0.2 * salary;
double maintenance_allowance = 0.3 * salary;
double SSNIT_allowance = 0.1 * salary;
double rent_allowance = 0.4 * salary;
double gross_salary = dressing_allowance + fuel_allowance + maintenance_allowance + SSNIT_allowance+ rent_allowance;
cout<<"The gross salary is: "<<gross_salary<<endl;
}
Comments
Leave a comment