Videocon gives a hike in the salaries for its employees based on the number of TVs sold by the employees in the financial year. Vishnu wants to know his new salary. Following are the requirements to solve the problem
a) If the No’s of TV’s sold is less than 5000, then the hike is 5%
b) If the No’s of TV’s sold is greater than or equal to Rs 5000 and less than 6500 then the hike is 7%
c) If the No’s of TV’s sold is greater than or equal to Rs 6500 then the hike is 9%
d) Capture Vishnu’s present salary and the no of TV’s sold by Vishnu
e) Display Vishnu’s new salary
#include <bits/stdc++.h>
using namespace std;
int main()
{
int tv_sold, salary,hike;
cout<<"Enter number of TV's sold: ";
cin>>tv_sold;
cout<<"Enter your Salary: ";
cin>>salary;
if (tv_sold < 5000)
{
hike = salary + (salary * 0.05);
cout<<"Your new Salary is: "<<hike;
}
else if (tv_sold >= 5000 or tv_sold < 6500)
{
hike = salary + (salary * 0.07);
cout<<"Your new Salary is: "<<hike;
}
else if (tv_sold > 6500)
{
hike = salary + (salary * 0.09);
cout<<"Your new Salary is: "<<hike;
}
return 0;
}
Comments
Leave a comment