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.
#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;
	}
}
Comments