Answer to Question #264846 in C++ for Cedric Bernardo

Question #264846

The XYZ Manufacturing Company plans to give year-end bonus 

to its employees. Make a flowchart and write a program that 

will compute for the year-end bonus of its employees 

considering the following criteria:

- If employee’s monthly salary is less than or equal to 

P7000, bonus is 50% of the salary.

- For employees with salaries greater than P7000, bonus is 

P7000.

- Print out the names, salaries and the corresponding 

bonuses of the employees.


1
Expert's answer
2021-11-12T17:35:59-0500
#include<iostream>
using namespace std;
int main()
{
	int n;
	string s;
	cout<<"Enter the employee name: ";
	cin>>s;
	cout<<"Enter the employee's salary: ";
	cin>>n;
	if(n<=7000){
		double bonus=0.5*n*12;
		cout<<s<<" your monthly salary is: p"<<n<<" and your yearly bonus is: p"<<bonus;
	}
	else if(n>7000){
		int bonus=7000*12+n;
		cout<<s<<" your monthly salary is: p"<<n<<" and your yearly bonus is: p"<<bonus;
	}
}

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