Answer to Question #237031 in C++ for c++

Question #237031

in a company an employee is paid as follows; if his basic salary is less than 50,000 then house allowance is 10% and inflation allowance is 5% of basic salary. if his salary is equal to or above 50,000 then his house allowance is equal to 10,000 and inflation allowance is 8% of basic salary. if the employee basic salary is input by the user, write a c++ program to find an employee's gross salary


1
Expert's answer
2021-09-17T11:31:08-0400
#include<iostream>
using namespace std;
int main(){
	double basic_salary;
	cout<<"Enter the basic salary\n";
	
	cin>>basic_salary;
	double house_allowance, inflation_allowance;
	if(basic_salary<50000){
		house_allowance = basic_salary * 0.1;
		inflation_allowance = basic_salary * 0.05;
	}
	else if(basic_salary>= 50000){
		house_allowance = 10000 ;
		inflation_allowance = basic_salary * 0.08;
	}
	double gross_pay = basic_salary + house_allowance + inflation_allowance;
	cout<<"The gross pay is:\t"<<gross_pay<<endl;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS