Employee Bonus Program in Python


The current year and the year in which the employee joined the organization are entered through the keyboard. If the number of years for which the employee has served the organization is greater than 3 then a bonus of Rs. 2500/- is given to the employee. If the years of service are not greater than 3, then the program should do nothing.

This program is written in the Python programming language and it is designed to calculate the bonus for an employee based on the number of years they have been with the company.

  • It starts by using the "input()" function to accept two values from the user, the current year and the year of joining, which are stored in variables named "current_year" and "join_year" respectively.
  • The program then uses subtraction operator to find the difference between current year and joining year.
  • The program then uses an if-else statement to check if the difference is greater than 3 years. If the condition is true, then the program prints the bonus amount of Rs 2500/-.
  • If the condition is false, the program simply prints the message "No Bonus.."
  • This program is useful for companies to determine bonus for their employees based on their years of service.

Source Code

current_year=int(input("Enter the Current Year :"))
join_year=int(input("Enter the Year of Joining :"))
diff=current_year-join_year
if(diff>3):
	print("Bonus of Rs : 2500 /-");
else:
	print("No Bonus..")

Output

Enter the Current Year :2022
Enter the Year of Joining :2009
Bonus of Rs : 2500 /-	

Example Programs