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
Leave a comment