Write a python program to accept the date of joining of service of n employees in an IT firm and count the number of employees whose number of years of service falls in the following year groups considering the following HR Policy of the firm. [Note: Consider the current date as 2021-11-30]
i) <2 ii) 2-7 iii) 8-19 iv) 20-32 v) >32
Ø If the number of years of service is less than 2 years, then consider them [Associate Software Engineer] working under the Probation period.
Ø If the number of years of service is in the range of 2-7 years, then consider them [Software Engineer] working as a permanent employee.
Ø If the number of years of service is in the range of 8-19 years, then consider them [Team Leader] working as a senior employee.
Ø If the number of years of service is in the range of 20-32 years, then consider them [Project Manager] as an executive employee.
Ø If the number of years of service is more than 32 years, then consider them as a Retired employee.
class Employee:
count = 0
def __init__(self, name, des, salary):
self.name = name
self.des = des
self.salary = salary
Employee.count = Employee.count + 1
def displayCount(self):
print("The number of employees in the organization are: ", self.count)
def displayEmp(self):
print ("Name of Employee is: ", self.name)
print ("Designation of Employee: ", self.des)
print ("Salary of Employee: ", self.salary)
e1 = Employee ("Mahesh", "Manager", 20000)
e2 = Employee ("Rahul", "Team Leader", 30000)
e1.displayCount()
print("Employee Details is:")
e1.displayEmp()
e2.displayEmp()
Comments
Leave a comment