Employee Management: Experiment Name:-Case Study Using Miniproject With Following Phases
Employee Management: Experiment Name:-Case Study Using Miniproject With Following Phases
Employee management makes it easy to check and track human resources department at
the press of a button. It makes the system easy to monitor and manage employees from
different location. This system helps in supervising employees work report and
productivity. Our employee management system includes a time tracking system that
saves both time and money. These all features help at the time of employee appraisals.
Key Features
Add manage employee
Manage employees personal details, family details, Company details
Add manage employee designations
Add view employee task status
Monitor employee call register list
View, approve / decline employee leave request
Monitor employee log details
Communicate with internal messaging center
View, edit employee payroll system
Search employee with name, designation or place of work
1
User can edit and view employee details
Code:
#include <stdio.h>
#include <conio.h>
#include <string.h>
typedef struct Employee
{
int id;
char fname[20];
char lname[20];
int age;
long salary;
} Employee;
Employee details[10];
int pos = -1;
void AddEmployee()
{
Employee emp;
if (pos >= 9)
{
printf("\n\nEMPLOYEE LIST IS FULL");
return;
}
clrscr();
printf("\nADD EMPLOYEE DETAILS\n\n1. ENTER EMPLOYEE ID: ");
scanf("%d", &emp.id);
printf("\n2. ENTER FIRST NAME OF EMPLOYEE: ");
scanf("%s", &emp.fname);
printf("\n3. ENTER LAST NAME OF EMPLOYEE: ");
scanf("%s", &emp.lname);
printf("\n4. ENTER AGE OF EMPLOYEE: ");
scanf("%d", &emp.age);
printf("\n5. ENTER SALARY OF EMPLOYEE: ");
scanf("%ld", &emp.salary);
details[++pos] = emp;
printf("\n\nDATA ADDED SUCCESSFULLY");
}
int search()
{
int id, i;
clrscr();
printf("\nENTER EMPLOYEE ID: ");
scanf("%d", &id);
for (i = 0; i < pos + 1; i++)
{
if (details[i].id == id)
{
2
return i;
}
}
return -1;
}
void SearchEmployee()
{
int p;
Employee e;
p = search();
if (p==-1)
{
printf("\nEMPLOYEE RECORDS NOT FOUND");
return;
}
e = details[p];
printf("\n\n---RECORD OF EMPLOYEE---\nEMPLOYEE ID: %d\nFIRST NAME: %s\nLAST
NAME: %s\nAGE: %d\nSALARY: %ld", e.id, e.fname, e.lname, e.age, e.salary);
}
void DeleteEmployee()
{
int p, i;
clrscr();
if (pos < 0)
{
printf("\n\nEMPLOYEE LIST IS EMPTY");
return;
}
p = search();
if (p==-1)
{
printf("\nEMPLOYEE RECORDS NOT FOUND");
return;
}
for (i = p; i <= pos; i++)
{
details[i] = details[i + 1];
}
pos--;
printf("\nEMPLOYEE ID DELETED");
}
void ModifyEmployee()
{
int p;
clrscr();
if (pos >= 9)
{
printf("\n\nEMPLOYEE LIST IS FULL");
return;
}
3
p = search();
printf("\nEDIT EMPLOYEE DETAILS\n\n1. ENTER EMPLOYEE ID: ");
scanf("%d", &details[p].id);
printf("\n2. ENTER FIRST NAME OF EMPLOYEE: ");
scanf("%s", &details[p].fname);
printf("\n3. ENTER LAST NAME OF EMPLOYEE: ");
scanf("%s", &details[p].lname);
printf("\n4. ENTER AGE OF EMPLOYEE: ");
scanf("%d", &details[p].age);
printf("\n5. ENTER SALARY OF EMPLOYEE: ");
scanf("%ld", &details[p].salary);
printf("\n\nDATA EDITED SUCCESSFULLY");
}
void ListEmployee()
{
int i;
Employee e;
clrscr();
if (pos < 0)
{
printf("\n\nEMPLOYEE LIST IS EMPTY");
return;
}
printf("\nLIST OF EMPLOYEE");
printf("\nEMP ID\tFIRST NAME\tLAST NAME\tAGE\tSALARY\n");
for (i = 0; i <= pos; i++)
{
e = details[i];
printf("%d\t%s\t%s\t%d\t%ld\n", e.id, e.fname, e.lname, e.age, e.salary);
}
}
void menu()
{
int c;
clrscr();
printf("\n---EMPLOYEE MANAGEMENT SYSTEM---\n\n1. ADD EMPLOYEE\n2. LIST
EMPLOYEE\n3. SEARCH EMPLOYEE\n4. MODIFY EMPLOYEE\n5. DELETE EMPLOYEE\n6.
EXIT\n\n[*] Choice: ");
scanf("%d", &c);
switch (c)
{
case 1:
AddEmployee();
break;
case 2:
ListEmployee();
break;
case 3:
SearchEmployee();
break;
4
case 4:
ModifyEmployee();
break;
case 5:
DeleteEmployee();
break;
case 6:
return;
default:
menu();
}
getch();
menu();
}
void main()
{
menu();
}
Output:
Conclusion:
Hence we studied and implemented system to fill curriculum gap for students i.e to
create Employee management system in C.