Answer to Question #299812 in C++ for saim

Question #299812

A company decided to give bonus to employee according to following criteria: Time period of Service Bonus if More than 10 years 10% if >=6 and <=10 8% if Less than 6 years 5%. Ask user for their salary and years of service and print the net bonus amount.

1
Expert's answer
2022-02-19T16:56:54-0500


#include <iostream>




using namespace std;


int main() {
	float salary;
	float netBonusAmount=-1;
	int numberYearsWorked;
	cout<<"Ente the salary: ";
	cin>>salary;
	cout<<"Ente the number of years of service: ";
	cin>>numberYearsWorked;


	if(numberYearsWorked>=6 && numberYearsWorked<=10){
		netBonusAmount=0.08*salary;
	}else if(numberYearsWorked>10 ){
		netBonusAmount=0.1*salary;
	}else{
		netBonusAmount=0.05*salary;
	}


	if(netBonusAmount>0 && salary>0){
		cout<<"The net bonus amount: "<<netBonusAmount<<"\n\n";
	}else{
		cout<<"Wrong data\n\n";
	}


	system("pause");
	return 0;
}

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