Answer to Question #257228 in C++ for Nana

Question #257228

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


1
Expert's answer
2021-10-27T00:26:05-0400
#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;
} 

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