/Employee-Management-System-with-Tax-Calculation

Design and implement an employee management system with separate classes for general employees, trainers (including overtime), and agents (including bonuses), each utilizing a central tax calculation component. This exercise challenges your object-oriented programming skills and understanding of employee data management.

Primary LanguagePython

Employee Management System

This Python module provides classes for managing employees, including calculating salaries and retirement dates.

Classes

IR

This class handles income tax calculation based on salary.

Methods:

  • getIR(salaire): Returns the income tax rate based on the salary.

IEmploye

Abstract base class for defining employee interface.

Abstract Methods:

  • 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.

Employe

Represents a generic employee.

Attributes:

  • 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.

Methods:

  • 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.

Formateur

Subclass of Employe representing a trainer employee.

Additional Attributes:

  • heureSup: Number of overtime hours worked.
  • tarifHSup: Hourly rate for overtime work.

Methods:

  • salaireAPayer(): Calculates the salary to be paid for a trainer.

Agent

Subclass of Employe representing an agent employee.

Additional Attributes:

  • primeResponsabilite: Responsibility bonus for the agent.

Methods:

  • salaireAPayer(): Calculates the salary to be paid for an agent.

Usage

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