0% found this document useful (0 votes)
18 views28 pages

DSU Project For Review

Uploaded by

priyanshu10824
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views28 pages

DSU Project For Review

Uploaded by

priyanshu10824
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 28

Nashik Gramin Shikshan Prasarak Mandal’s

BRAHMA VALLEY COLLEGE OF TECHNICAL


EDUCATION, ANJANERI, NASHIK

Department of Computer Technology

PROJECT REOPRT

YEAR 2024-2025

Project Title: Dynamic Employee Management System Using


Linked Lists in C

Sr.No. Student Name Seat No. Enrollment No.

1 SUDHANSHU KUMAVAT 23611480137


2 OM JADHAV 23611480128
3 MOHIT DEORE 23611480121
4 YOGESH BORSE 23611480117

[Project Guide: Prof. S.A Bhamare]

MAHARASHTRA STATE
BOARD OF TECHNICAL EDUCATION (MSBTE), MUMBAI

Brahma Valley College of Technical Education,


Anjaneri, Nashik
Department of Computer Technology

2024-2025

A
Project Report
On
[Dynamic Employee Management System Using Linked Lists in C]
By
[Sudhanshu Kumavat]
[Om Jadhav]

[Mohit Deore]

[Yogesh Borse]

Under the guidance

[Prof. S.A BHAMARE]


Brahma Valley College of Technical
Education,
Anjaneri, Nas
hik
Department of Computer Technology

CERTIFICATE
This is to certify that
[Sudhanshu Kumavat]
[Om Jadhav]
[Mohit Deore]
[Yogesh Borse]

have successfully completed their Project on “Dynamic Employee Management System


Using Linked Lists in C” at Brahma Valley College of Technical Education, Anjaneri,
Nashik in the partial fulfilment of the Diploma course in Computer Technology in the
academic Year 2024-2025.

Prof. S.A Bhamare


Guide

Prof. M.M Kulkarni Prof. V. P. Nikhade


Head of the Department Principal
ACKNOWLEDGEMENT
We would like to express our heartfelt gratitude to everyone who contributed to the
successful completion of our project, Dynamic Employee Management System Using
Linked Lists in C.
First and foremost, we extend our sincere thanks to Prof. S.A Bhamare, our Project Guide,
for her invaluable guidance, support, and continuous encouragement throughout the
development of this project. Her expertise and constructive feedback have greatly contributed
to our learning experience.
We are also deeply grateful to Prof. M.M. Kulkarni, Head of the Department, for
providing us with the opportunity and resources to undertake this project, as well as for his
leadership and unwavering support during the course of our study.
Additionally, we would like to thank Prof. V.P. Nikhade, Principal of Brahma Valley
College of Technical Education, for his encouragement and for fostering an environment
conducive to learning and innovation.
Lastly, we express our appreciation to all the faculty members, our friends, who supported
and motivated us throughout this journey.
Thank you all for making this project a success.

[Sudhanshu Kumavat]
[Om Jadhav]
[Mohit Deore]
[Yogesh Borse]

Index
Sr. Contents
No.
1 Abstract

2 Introduction

3 Aim Of The Project

4 Detailed System Overview

5 Hardware And Software Requirement

6 Source Code

7 Code Explanation And Logic

8 Output

9 Challenges Faced and Solutions

10 Future Enhancement

11 Conclusion
ABSTRACT

The Employee Management System is a simple yet efficient tool designed to manage
employee records such as ID, name, department, and salary. Implemented using C language
and data structures like linked lists, this system supports adding, searching, displaying,
deleting, and sorting employees by salary. The system prioritizes ease of use and memory
efficiency through dynamic memory management.
INTRODUCTION

Employee management is essential in any organization to handle information efficiently. This


project presents a system that allows administrators to store, retrieve, modify, and delete
employee data using fundamental data structures. It is designed to be scalable, simple to
understand, and easy to maintain..
AIM OF THE PROJECT

1. To develop a structured system that manages employee data efficiently.

2.To utilize data structures such as linked lists for optimal data storage and retrieval.

3.To provide functionalities for inserting, searching, displaying, deleting, and sorting
employees.

4.To ensure proper memory management through dynamic memory allocation.

5. To offer a user-friendly console-based interface for managing employee records.

DETAILED SYSTEM OVERVIEW

The system comprises several core functions to manage employee records:

 Employee Creation and Insertion: The user can add new employee details to
the system.

 Search: Employees can be searched by their unique ID.

 Display: All employees can be displayed, showing detailed information.

 Delete: Employees can be removed from the system by ID.

 Sorting: The system supports sorting employees based on their salary. The system is
implemented using a singly linked list for dynamic management of employee records,
enabling efficient addition, removal, and searching.
HARDWARE AND SOFTWARE REQUIREMENTS

Hardware Requirements

 Processor: Intel Core i3 or above


 RAM: 2GB or higher
 Hard Disk: 100MB of free space

Software Requirements
Operating System: Windows/Linux
Compiler: GCC or any C language compiler (e.g., Code::Blocks, Dev-C++)
Text Editor: Visual Studio Code, Notepad++, or any IDE
SOURCE CODE

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

// Define the structure for an employee


typedef struct Employee {
int id;
char name[50];
char department[30];
float salary;
struct Employee* next;
} Employee;

// Head of the employee linked list


Employee* head = NULL;

// Function to create a new employee node


Employee* createEmployee(int id, char name[], char department[], float salary) {
Employee* newEmployee = (Employee*)malloc(sizeof(Employee));
newEmployee->id = id;
strcpy(newEmployee->name, name);
strcpy(newEmployee->department, department);
newEmployee->salary = salary;
newEmployee->next = NULL;
return newEmployee;
}

// Function to insert employee at the end of the linked list


void insertEmployee(int id, char name[], char department[], float salary) {
Employee* newEmployee = createEmployee(id, name, department, salary);
if (head == NULL) {
head = newEmployee;
} else {
Employee* temp = head;
while (temp->next != NULL) {
temp = temp->next;
}
temp->next = newEmployee;
}
// Add 3 new lines after insertion
printf("\n\n\n");
printf("Employee added successfully!\n\n");
}

// Function to search for an employee by ID


Employee* searchEmployee(int id) {
Employee* temp = head;
while (temp != NULL) {
if (temp->id == id) {
return temp;
}
temp = temp->next;
}
return NULL;
}

// Function to display employee details


void displayEmployee(Employee* employee) {
if (employee == NULL) {
printf("Employee not found.\n\n");
return;
}
printf("Employee ID: %d\n", employee->id);
printf("Name: %s\n", employee->name);
printf("Department: %s\n", employee->department);
printf("Salary: %.2f\n\n", employee->salary);
}

// Function to display all employees


void displayAllEmployees() {
if (head == NULL) {
printf("No employees to display.\n\n");
return;
}
Employee* temp = head;
while (temp != NULL) {
displayEmployee(temp);
temp = temp->next;
}
}

// Function to delete an employee by ID


void deleteEmployee(int id) {
if (head == NULL) {
printf("No employees to delete.\n\n");
return;
}
if (head->id == id) {
Employee* temp = head;
head = head->next;
free(temp);
printf("\n\n\n"); // Add 3 new lines before printing output
printf("Employee deleted successfully!\n\n");
return;
}
Employee* temp = head;
while (temp->next != NULL && temp->next->id != id) {
temp = temp->next;
}
if (temp->next == NULL) {
printf("\n\n\n"); // Add 3 new lines before printing output
printf("Employee not found.\n\n");
} else {
Employee* toDelete = temp->next;
temp->next = temp->next->next;
free(toDelete);
printf("\n\n\n"); // Add 3 new lines before printing output
printf("Employee deleted successfully!\n\n");
}
}

// Function to sort employees by salary using Bubble Sort


void sortEmployeesBySalary() {
if (head == NULL) {
printf("No employees to sort.\n\n");
return;
}
Employee* i = head;
Employee* j = NULL;
int swapped;
do {
swapped = 0;
i = head;
while (i->next != j) {
if (i->salary > i->next->salary) {
// Swap employee data
int tempId = i->id;
float tempSalary = i->salary;
char tempName[50], tempDept[30];
strcpy(tempName, i->name);
strcpy(tempDept, i->department);

i->id = i->next->id;
i->salary = i->next->salary;
strcpy(i->name, i->next->name);
strcpy(i->department, i->next->department);

i->next->id = tempId;
i->next->salary = tempSalary;
strcpy(i->next->name, tempName);
strcpy(i->next->department, tempDept);

swapped = 1;
}
i = i->next;
}
j = i;
} while (swapped);
printf("\n\n\n"); // Add 3 new lines before printing output
printf("Employees sorted by salary.\n\n");
}

// Main function for the Employee Management System


int main() {
int choice, id;
char name[50], department[30];
float salary;

while (1) {
printf("===== Employee Management System =====\n");
printf("1. Add Employee\n");
printf("2. Search Employee by ID\n");
printf("3. Display All Employees\n");
printf("4. Delete Employee by ID\n");
printf("5. Sort Employees by Salary\n");
printf("6. Exit\n");
printf("Enter your choice: ");
scanf("%d", &choice);

switch (choice) {
case 1:
printf("Enter Employee ID: ");
scanf("%d", &id);
printf("Enter Name: ");
scanf("%s", name);
printf("Enter Department: ");
scanf("%s", department);
printf("Enter Salary: ");
scanf("%f", &salary);
printf("\n\n\n"); // Add 3 new lines after inputs
insertEmployee(id, name, department, salary);
break;

case 2:
printf("Enter Employee ID to search: ");
scanf("%d", &id);
printf("\n\n\n"); // Add 3 new lines after inputs
Employee* emp = searchEmployee(id);
displayEmployee(emp);
break;

case 3:
printf("\n\n\n"); // Add 3 new lines before printing output
displayAllEmployees();
break;

case 4:
printf("Enter Employee ID to delete: ");
scanf("%d", &id);
printf("\n\n\n"); // Add 3 new lines after inputs
deleteEmployee(id);
break;

case 5:
printf("\n\n\n"); // Add 3 new lines before printing output
sortEmployeesBySalary();
break;
case 6:
printf("\n\n\n"); // Add 3 new lines before printing output
printf("Exiting Employee Management System...\n");
exit(0);
break;

default:
printf("\n\n\n"); // Add 3 new lines before printing output
printf("Invalid choice. Please try again.\n\n");
}
}
return 0;
}
CODE EXPLANATION AND LOGIC

Data Structure: A singly linked list is used to store employee details dynamically,
ensuring efficient memory utilization.

Functions:
 createEmployee: Dynamically allocates memory for a new employee node.
 insertEmployee: Adds new employees at the end of the list.
 searchEmployee: Searches for an employee using their ID.
 deleteEmployee: Removes an employee from the system.
 sortEmployeesBySalary: Sorts the employees in ascending order of salary using
Bubble Sort.
 Each function ensures the program is modular, and dynamic memory allocation
(malloc) is used to prevent memory wastage.
OUTPUT:
1. Overview Of Choices In Employee Management System

2. Adding Employee In Employee Management System Using Add


Employee Choice
In The Above Output Screenshot, The Employee With ID:200,
Name: Sudhanshu, Department: Computer, Salary: 50,000 Is Newly
Added.
3. Displaying The Information Of Employees Using Display All
Employees Choice

In The Above Output Screenshot, The Information Of All Employee Are


Displayed With ID:(200,201,202) Name: (Sudhanshu,Yogesh,Mohit)
4. Sorting The Employees In Ascending Order According To Their
Salaries Using Sort Employee By Salary Choice And Displaying
The Information Of Sorted Employees
In The Above Output Screenshot, The Employees Are Arranged Or Sorted
In Ascending Order And Displayed The Information Of Sorted Employess
5. Deleting The Employees By Their ID Using Delete Employee By
ID Choice And Display Current Information Of Employee
In The Above Output Screenshots, The Employee With ID: 201,Name:
Yogesh, Department: Electrical, Salary 20,000 Is Deleted, And
Displayed The Current Information Of Employees
CHALLENGES FACED AND SOLUTION

 Challenge 1: Efficient memory management with dynamic data.


 Solution: Implemented a linked list to allow dynamic memory allocation, ensuring
scalability and avoiding memory wastage.

 Challenge 2: Sorting large datasets by salary.
 Solution: Used a simple and effective sorting algorithm (Bubble Sort). Though not
the most efficient for larger datasets, it works well for small to medium-sized records .

 Challenge 3: Ensuring the code is user-friendly and clear.
 Solution: Clear prompts were provided for user inputs, and spacing was introduced
before output to enhance readability.

FUTURE ENHANCEMENT

Upgrade the sorting algorithm: Replace Bubble Sort with more efficient sorting
algorithms like Merge Sort or Quick Sort to handle larger datasets.

Advanced search: Implement a binary search using a hash table for faster lookups.

Graphical User Interface (GUI): Transform the system into a GUI-based


application for better user interaction.

File storage: Introduce file handling to store employee records permanently, enabling
data persistence across program executions.
CONCLUSION

The Employee Management System provides an efficient and structured way to manage employee
records, utilizing the power of linked lists for dynamic memory management. The system is
simple to understand, extensible, and capable of handling core employee operations. With
potential future enhancements, it can scale to meet larger and more complex needs.

You might also like