Cyrus A.
Bernardo
BSIT 2-C
class Employee:
def __init__(self, emp_ID, name, position, salary, department, status):
self.emp_ID = emp_ID
[Link] = name
[Link] = position
[Link] = salary
[Link] = department
[Link] = status
def copy(self):
return Employee(self.emp_ID, [Link], [Link], [Link], [Link],
[Link])
def promote(self, new_position, increase):
[Link] = new_position
[Link] += increase
print("Employee has been promoted.")
def terminate(self):
[Link] = "Inactive"
print(f"{[Link]} is now Inactive.")
def reactivate(self):
[Link] = "Active"
print(f"{[Link]} is reactivated.")
def apply_bonus(self, percent):
if [Link] == "Inactive":
print("\nbonus does not apply to an inactive employee.")
print("=" *145 + "\n")
elif 1 <= percent <= 20:
[Link] += [Link] * (percent / 100)
print("Bonus applied successfully.")
def display_info(self):
print(f"\nID: {self.emp_ID}")
print(f"Name: {[Link]}")
print(f"Position: {[Link]}")
print(f"Department: {[Link]}")
print(f"Salary: ₱{[Link]}")
print(f"Status: {[Link]}")
emp1 = Employee(0, "Kristann", "Staff", 0, "General", "Active")
emp1.display_info()
emp2 = Employee(101, "Ross", "Manager", 120000, "Finance", "Active")
Cyrus A. Bernardo
BSIT 2-C
emp2.display_info()
emp3 = [Link]()
[Link] = "Oro"
emp3.display_info()
print()
[Link]("CEO", 5000)
print()
[Link]()
print()
[Link]("Director", 30000)
print()
emp3.apply_bonus(15)
print()
[Link]()
print()
emp2.apply_bonus(15)
print()
emp1.display_info()
emp2.display_info()
emp3.display_info()