jbm manufacturing company plans to give a year end bonus to each of its employee consider the following conditions: if the employee's monthly salary is less than or equal to 2,000 pesos, the bonus is 50% of the salary for employees with salaries greater than 2,000 pesos the bonus is 1,500 pesos print the name, salary, and corresponding bonus for each employee
#include<iostream>
using namespace std;
int main()
{
string name;
int salary,bonus;
cout<<"Enter the name of the employee: ";
cin>>name;
cout<<"Enter the salary of the employee: ";
cin>>salary;
if(salary<2000)
{
bonus=0.5*salary;
cout<<"Name: "<<name<<", salary is: "<<salary<<" and the bonus is: "<<bonus;
}
else if(salary>2000)
{
bonus=1500;
cout<<"Name: "<<name<<", salary is: "<<salary<<", and the bonus is: "<<bonus;
}
}
Comments
Leave a comment