Computer Science, asked by tjalbhadra8005, 18 days ago

Write a program to input the salary of a person calculate the bonus according to the salary if salary is greater 20000 then bonus perscent is 5% else 12%

Answers

Answered by enigma0x00
0

--------------------------------------------------------------------

C++ Implementation:

--------------------------------------------------------------------

#include<iostream>

using namespace std;

int main()

{

float salary,bonus;

cout<<"Enter Salary of the person:";

cin>>salary;

if(salary>20000)

{

bonus=0.05*salary;

}

else

{

bonus=0.15*salary;

}

cout<<"Bonus of the person is:"<<bonus;

return 0;

}

---------------------------------------------------------------------

Python implementation:

---------------------------------------------------------------------

Explanation:

salary=float(input("Enter Salary"))

if salary>20000:

bonus=0.05*salary

else:

bonus=0.15*salary

print(salary)

Similar questions