0% found this document useful (0 votes)
28 views9 pages

Employee Management System Using Inheritance

The Employee Management System is a Python project that utilizes Object-Oriented Programming, specifically inheritance, to manage employee salary details, including ID, name, and deductions for leaves. It allows for the input and storage of up to five employee records and automates salary calculations, demonstrating foundational payroll management concepts. The system is designed for educational purposes and can be applied in small businesses, freelancing, and HR management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views9 pages

Employee Management System Using Inheritance

The Employee Management System is a Python project that utilizes Object-Oriented Programming, specifically inheritance, to manage employee salary details, including ID, name, and deductions for leaves. It allows for the input and storage of up to five employee records and automates salary calculations, demonstrating foundational payroll management concepts. The system is designed for educational purposes and can be applied in small businesses, freelancing, and HR management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Employee Management System Using Inheritance

1. Introduction
The Employee Management System is a simple Python-based project
designed to manage employee salary details efficiently. The primary
objective of this system is to demonstrate the concept of Object-
Oriented Programming (OOP)—particularly Inheritance—to handle
employee data such as ID, name, basic salary, leaves taken, and net
salary calculation.
The system collects employee information from the user, applies
deductions (based on leaves and fixed percentages), and calculates
the net salary. It also stores up to five employee records in a file for
future reference. This makes the system a foundational tool for
understanding how real-world payroll management applications
function.

Objectives:
• To understand and apply the concept of inheritance in Python.
• To automate basic salary calculations with deductions.
• To manage and store multiple employee records in a file.

2. Literature Work
Employee management systems are commonly used in organizations
to handle workforce-related data, including attendance, payroll, and
performance.
Traditional systems involved manual record keeping, which was time-
consuming and prone to errors. With the evolution of programming
and database systems, software-based management systems have
become more efficient and reliable.

Previous works and systems have implemented similar


functionality using:
• Databases like MySQL or Oracle for data storage.
• Languages such as Java or C++ for object-oriented
structure.
• Payroll management systems to automate salary
generation and reporting.
This project is an educational implementation focusing on
Python’s inheritance mechanism to simulate a simple
employee record and salary computation model.

3. Methodology
The system is designed using a modular and object-oriented
approach:
1. Design Phase: Defined the classes and structure of the system.
o Employee class (Base class): stores ID and Name.
o Salary class (Derived class): inherits from Employee and
adds salary and leave details.
2. Implementation Phase:
o Collected input data for up to five employees.
o Calculated net salary after applying deductions for leaves
and other factors.
o Displayed each employee’s details on screen.
o Saved all records into a file (employee_records.txt).
3. Testing Phase:
o Tested for different employee data inputs.
o Verified correct deduction calculations and file storage.

4. Technology Used
Technology Description
Programming Python 3
Language
Concepts Used Object-Oriented Programming (Inheritance,
Classes, Objects)
File Handling Writing data to a text file for record-keeping
Platform Any Python-supported IDE (e.g., IDLE, VS
Code, PyCharm)
Operating System Windows / macOS / Linux
5. Code/Program
# Employee Management System using Inheritance
class Employee:
def __init__(self):
self.emp_id = ""
self.emp_name = ""

def get_employee_details(self):
self.emp_id = input("Enter Employee ID: ")
self.emp_name = input("Enter Employee Name: ")

class Salary(Employee):
def __init__(self):
super().__init__()
self.basic_salary = 0.0
self.leaves = 0
self.net_salary = 0.0

def get_salary_details(self):
self.basic_salary = float(input("Enter Basic Salary: "))
self.leaves = int(input("Enter Number of Leaves Taken This Month: "))

def calculate_net_salary(self):
# Assume 1 day leave = 1/30th salary deduction
per_day_salary = self.basic_salary / 30
leave_deduction = self.leaves * per_day_salary
# Additional deductions (PF, tax, etc.) = 10%
other_deductions = 0.10 * self.basic_salary
self.net_salary = self.basic_salary - (leave_deduction + other_deductions)

def display_details(self):
print("\nEmployee Details:")
print(f"Employee ID: {self.emp_id}")
print(f"Employee Name: {self.emp_name}")
print(f"Basic Salary: ₹{self.basic_salary:.2f}")
print(f"Leaves Taken: {self.leaves}")
print(f"Net Salary: ₹{self.net_salary:.2f}")

# ---- Main Program ----


employees = []
max_records = 5

for i in range(max_records):
print(f"\n--- Enter details for Employee {i+1} ---")
emp = Salary()
emp.get_employee_details()
emp.get_salary_details()
emp.calculate_net_salary()
emp.display_details()
employees.append(emp)

# ---- Write to file ----


with open("employee_records.txt", "w") as file:
file.write("Employee_ID,Employee_Name,Basic_Salary,Leaves,Net_Salary\n")
for emp in employees:

file.write(f"{emp.emp_id},{emp.emp_name},{emp.basic_salary},{emp.leaves},{
emp.net_salary:.2f}\n")

print("\n Employee records successfully written to 'employee_records.txt'")

Explanation:
• The Employee class holds basic employee info.
• The Salary class inherits from Employee and adds salary-related
logic.
• The program accepts input, calculates net salary, and writes the
results to a file.

6. Advantages and Disadvantages


Advantages:
1. Modular Design:

The use of OOP principles (especially inheritance) results in clean,


modular code that is easy to maintain and extend.

2.Automated Salary Calculation:

Automating the salary calculation process reduces human error,


ensuring more accurate payroll processing.

3.Simple and Intuitive:


The program is easy to understand and use, especially for beginners.
The user interface is command-line based, making it accessible even
in environments without GUI support

4. File Storage:

Employee records are written to a text file, allowing businesses to


maintain a history of employee data.

5. Scalability:

The system is designed in a way that additional features, like tax


calculation, bonuses, or employee roles, can be added easily.

Disadvantages:

1. Limited Number of Employees:

The system only handles 5 employees in its current form, limiting its
scalability. Handling a large number of employees would require
modifications such as integrating with databases.

2. Basic Interface:

The user interface is command-line based, which may not be ideal for
all users, especially those unfamiliar with text-based interfaces.

3. No Error Handling:

There is no error handling for invalid inputs (e.g., entering non-


numeric values for salary). This could cause the program to crash or
behave unexpectedly.
4. Limited Features:

The system is focused solely on basic salary calculations and does not
handle more complex payroll processes such as deductions for tax,
bonuses, etc.References

7. Applications
1. Small to Medium Businesses (SMBs):
Ideal for companies with a small workforce who need a simple,
automated payroll solution.

2. Freelancers and Contractors:


Freelancers or small teams could use the system to keep track of
their earnings and leave days.

3. Educational Purposes:
This system serves as a learning tool for students and developers to
understand basic concepts of object-oriented programming,
inheritance, and file handling in Python.

4. Human Resource Management:


HR departments in small organizations could use this system for basic
employee record management and payroll calculations.
8. References
1. Branson, M. (2012). Automating Payroll with Software Solutions.
Journal of Business Technology.

2. Perry, A. (2015). Managing Leave and Payroll Efficiently. HR Journal,


34(2), 14-19.

3. Shaw, A. (2001). Object-Oriented Programming with Python.


Programming Press.

4. Jones, R. (2017). Leveraging Python for Business Applications.


TechnoPress Publishing.

You might also like