The program is a basic employee management system defined across two files. It allows for the creation of employee profiles, assessing retirement eligibility based on years of employment, and applying a 10% pay raise to an employee's salary.
Employee 2 name: Roger
Employee 2 salary: 67800.21
Employee 1 salary: 121074.40
Employee 1 receives 10% payrise, new salary: 133181.84
class employees: def __init__(self, name, role, salary, years_employed): self.name = name self.role = role self.salary = salary self.years_employed = years_employed def retirement(self): if self.years_employed >= 10: print("{} can retire.".format(self.name)) else: print("{} can not retire.".format(self.name)) def payrise(self): self.salary = ((self.salary/100) * 10) + self.salary
from employees import employees def main(): employee1 = employees("Alex", "Director", 121074.40, 12) employee2 = employees("Roger", "Clerk 1", 67800.21, 8) print("Employee 2 name: {}".format(employee2.name)) print("Employee 2 salary: {:.2f}".format(employee2.salary)) print("Employee 1 salary: {:.2f}".format(employee1.salary)) employee1.payrise() print("Employee 1 receives a 10% payrise, new salary: {:.2f}".format(employee1.salary)) if __name__ == "__main__": main()