This Python module provides classes for managing employees, including calculating salaries and retirement dates.
This class handles income tax calculation based on salary.
getIR(salaire)
: Returns the income tax rate based on the salary.
Abstract base class for defining employee interface.
age()
: Returns the age of the employee.anciennete()
: Returns the years of seniority of the employee.dateRetraite(ageRetraite)
: Returns the retirement date based on the retirement age.
Represents a generic employee.
matricule
: Unique identifier for the employee.nom
: Name of the employee.dateNaissance
: Date of birth of the employee.dateEmbauche
: Employment start date of the employee.salaireBase
: Base salary of the employee.
age()
: Returns the age of the employee.anciennete()
: Returns the years of seniority of the employee.dateRetraite(ageRetraite)
: Returns the retirement date based on the retirement age.salaireAPayer()
: Abstract method to calculate the salary to be paid.
Subclass of Employe
representing a trainer employee.
heureSup
: Number of overtime hours worked.tarifHSup
: Hourly rate for overtime work.
salaireAPayer()
: Calculates the salary to be paid for a trainer.
Subclass of Employe
representing an agent employee.
primeResponsabilite
: Responsibility bonus for the agent.
salaireAPayer()
: Calculates the salary to be paid for an agent.
Instantiate the desired type of employee and use the salaireAPayer()
method to calculate their salary.
Example:
from datetime import datetime
from employee_management import Formateur, Agent
# Create a trainer employee
trainer = Formateur("John Doe", "1990-05-15", "2020-01-01", 40000, 10, 70.00)
print(trainer.salaireAPayer()) # Output: Calculated salary for the trainer
# Create an agent employee
agent = Agent("Alice Smith", "1985-03-20", "2018-05-10", 45000, 2000)
print(agent.salaireAPayer()) # Output: Calculated salary for the agent