Oop Microproject

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 19

A

PROJECT REPORT
ON

EMPLOYEE MANAGEMENT
SYSTEM
SUBMITTED BY
Miss. Sonawane Sakshi Janardhan [164]

Miss. Gawali Siddhi Balasaheb [169]

Miss. Bhendekar Priyanka Kadbul [173]

Under guidance of
Prof.P.M.Dhanrao

DEPARTMENT COMPUTER TECHNOLOGY


Sanjivani rural education society’s

SANJIVANI K.B.P.POLYTECHNIC
KOPARGOAN-423603,DIST:AHMEDNAGAR

2022-2023
Sanjivani Rural Education Society’s

SANJIVANI K. B. P.POLYTECHNIC
DEPARTMENT OF COMPUTER TECHNOLOGY

CERTIFICATE
This is to certify that the project report entitled

EMPLOYEE MANAGEMENT
SYSTEM
Submitted By
Miss. Sonawane Sakshi Janardhan [164]

Miss. Gawali Siddhi Balasaheb [169]

Miss. Bhendekar Priyanka Kadbul [173]


Under teachers supervision and guidance for partial fulfillment of the requirement for
Diploma in Computer Technology affiliated to
Maharashtra State Board of Technical Education,
Mumbai. For academic year
2022-2023

Prof.P.M.Dhanrao Prof.G .N. Jorvekar


(Subject Teacher) (H.O.D)
ACKNOWLEDGMENT
We would take this opportunity to express our sincere thanks and gratitude to our Project Guide Prof.
P.M.Dhanrao Department of Computer Technology, Sanjivani K.B.P.Polytechnic, Kopargaon. For his
vital guidance and support in completing this project. Lots of thanks to the Head of Computer technology
Department Mr. G.N. Jorvekar for providing us with the best support we ever had. We like to express
our sincere gratitude to Mr. A. R. Mirikar, Principal, Sanjivani K. B. P. Polytechnic, Kopargaon for
providing a great platform to complete the project within the scheduled time. Last but not the least; we
would like to say thanks to our family and friends for their never-ending love, help, and support in so
many ways through all this time. A big thanks to all who have willingly helped us out with their ability.

Miss. Sonawane Sakshi Janardhan [164]

Miss. Gawail Siddhi Balasaheb [169]

Miss. Behndekar Priyanka Kadbul [173]


INDEX
1. Introduction
2. Applications of Employee Management System
3. Source Code
4. Output
5. Conclusion
INTRODUCTION
Employee Management System is based on a concept to store and generate all
the records of the employees. This program is considered as a simple database of
employees in an office, an organization where the user can store employees record
easily as it is not time-consuming. Here at first, the user has to pass through login
system to get access then he/she can add employee’s data, view list of employees,
modify and remove employee details. The whole project is designed in ‘C++’
language and different variables and strings have been used for the development of
this project. This project is easy to operate and understood by the users.
Employee management system using C++ is menu driven program which allows
us to add, update, delete and search record of an employee working in an
organization. The program employee management system store employee ID,
name, post, department and salary of employee. Initially, it has no data. Thus, we
have to add employee records choosing appropriate option in this program (i.e.
selecting option #1).
Employee Management system using C++ program uses EmpID as unique
identifier (i.e. primary key) to recognize employee. So, we can’t add two
employees having same ID. After successful entry of records of some employee,
we can search record on the basic of ID or department. We can search particular
employee from ID choosing option #2 and if we want to see all employee working
in a department, we have to choose another option (i.e. option#3 in menu). We can
list all employee records also using option #4 in menu. Again, we can update and
delete existing record. Thus, this project is useful to mange employee records in an
organization.
Applications of Employee Management
System:-

1. Maintain a database for all your former and current employees


Complete, searchable, and secure records that includes information such as
the employee’s personal details, bank details, emergency contacts, and even
a record of his/her sick leaves.

2. Reduce the paperwork


An efficient employee management software will allow employees to request
time off, submit timesheets or documents and allows employees to audit or
approve submissions or requests.This negates the need to work with HR or
submit unnecessary pieces of paper.

3. Keeps track of time and attendance


Employees and managers have an instant record of absenteeism and the
number of hours put into work everyday. This allows employees to be more
responsible and stay on top of their punctuality and absenteeism rates
before it becomes in issue.

4. Asset Management
When an employee leaves the company, managers can keep track and
monitor the return of any equipment that was provided to the employee by
the organization.

5. Track progress of the company


Information is constantly being constantly being collected on the employee
management software, making it easy to gauge the company’s
progress.Instead of having to spend time putting together reports to see how
the company is doing, a quick look at the information on the software
should allow managers to constantly and accurately track the company’s
progress.

SOURCE CODE
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
#include<stdlib.h>
#include<iomanip.h>
#include<string.h>
#include<stdio.h>
const char* fileName="Employee.txt";

class Employee
{
private:
int EmpID;
char EmpName[50],Post[50],Department[10];
float Salary;
public:
void ReadData();
int GetID();
void DisplayRecord();
char* GetDepartment();
};

void Employee::ReadData()
{
cout<<endl<<"Employee ID:";
cin>>EmpID;
cout<<"Employee Name:";
cin>>EmpName;
cout<<"Employee's Post:";
cin>>Post;
cout<<"Employee's Department:";
cin>>Department;
cout<<"Salary:";
cin>>Salary;
}

void Employee::DisplayRecord()
{
cout<<endl<<"______________________________________________________
___________________";
cout<<endl<<setw(5)<<EmpID<<setw(15)<<EmpName<<setw(15)<<Post<<setw
(15)<<Department<<setw(8)<<Salary;
}
int Employee::GetID()
{
return EmpID;
}
char* Employee::GetDepartment()
{
return Department;
}
void main()
{
Employee emp,e;
char option,ch,Dept[50];
int ID,isFound;
clrscr();
fstream file;
file.open(fileName,ios::ate|ios::in|ios::out|ios::binary);
do
{
cout<<"*******Menu********";
cout<<endl<<"Enter your option";
cout<<endl<<"1 => Add a new record";
cout<<endl<<"2 => Search record from employee id";
cout<<endl<<"3 => List Employee of particular department";
cout<<endl<<"4 => Display all employee";
cout<<endl<<"5 => Update record of an employee";
cout<<endl<<"6 => Delete record of particular employee";
cout<<endl<<"7 => Exit from the program"<<endl;
cout<<"********************"<<endl;
cin>>option;
switch(option)
{
case '1':
emp.ReadData();
file.seekg(0,ios::beg);
isFound=0;
file.read((char*)&e,sizeof(e));
while(!file.eof())
{
if(e.GetID()==emp.GetID())
{
cout<<"This ID already exist...Try for another ID";
isFound=1;
break;
}
file.read((char*)&e,sizeof(e));
}
if(isFound==1)
break;
file.clear();
file.seekp(0,ios::end);
file.write((char*)&emp, sizeof(emp));
cout<<endl<<"New record has been added successfully...";
break;

case '2':
isFound=0;
cout<<endl<<"Enter ID of an employee to be searched:";
cin>>ID;
file.seekg(0,ios::beg);
file.read((char*)&e,sizeof(e));
while(!file.eof())
{
if(e.GetID()==ID)
{
cout<<endl<<"The record found...."<<endl;
cout<<endl<<setw(5)<<"ID"<<setw(15)<<"Name"<<setw(15)<<"Post"<<setw(15
)<<"Department"<<setw(8)<<"Salary";
e.DisplayRecord();
isFound=1;
break;
}
file.read((char*)&e,sizeof(e));
}
file.clear();
if(isFound==0)
cout<<endl<<"Data not found for employee ID#"<<ID;
break;
case '3':
isFound=0;
cout<<"Enter department name to list employee within it:";
cin>>Dept;
file.seekg(0,ios::beg);
file.read((char*)&e,sizeof(e));
while(!file.eof())
{
if(strcmp(e.GetDepartment(),Dept)==0)
{
cout<<endl<<"The record found for this department"<<endl;

cout<<endl<<setw(5)<<"ID"<<setw(15)<<"Name"<<setw(15)<<"Post"<<setw(15
)<<"Department"<<setw(8)<<"Salary";
e.DisplayRecord();
isFound=1;
break;
}
file.read((char*)&e,sizeof(e));
}
file.clear();
if(isFound==0)
cout<<endl<<"Data not found for department"<<Dept;
break;

case '4':
cout<<endl<<"Record for employee";
file.clear();
file.seekg(0,ios::beg);
int counter=0;
file.read((char*)&e,sizeof(e));
while(!file.eof())
{
counter++;
if(counter==1)
{
cout<<endl<<setw(5)<<"ID"<<setw(15)<<"Name"<<setw(15)<<"Post"<<setw(15
)<<"Department"<<setw(8)<<"Salary";
}
e.DisplayRecord();
file.read((char*)&e,sizeof(e));
}
cout<<endl<<counter<<"records found......";
file.clear();
break;

case '5':
int recordNo=0;
cout<<endl<<"File is being modified....";
cout<<endl<<"Enter employee ID to be updated:";
cin>>ID;
isFound=0;
file.seekg(0,ios::beg);
file.read((char*)&e,sizeof(e));
while(!file.eof())
{
recordNo++;
if(e.GetID()==ID)
{
cout<<"The old record of employee having ID"<<ID<< "is:";
e.DisplayRecord();
isFound=1;
break;
}
file.read((char*)&e,sizeof(e));
}
if(isFound==0)
{
cout<<endl<<"Data not found for employee ID#"<<ID;
break;
}
file.clear();
int location=(recordNo-1)*sizeof(e);
file.seekp(location,ios::beg);
cout<<endl<<"Enter new record for employee having ID"<<ID;
e.ReadData();
file.write((char*)&e, sizeof(e));
break;

case '6':
recordNo=0;
cout<<endl<<"Enter employment ID to be deleted:";
cin>>ID;
isFound=0;
file.seekg(0,ios::beg);
file.read((char*)&e,sizeof(e));
while(!file.eof())
{
recordNo++;
if(e.GetID()==ID)
{
cout<<" The old record of employee having ID "<<ID<< " is: ";
e.DisplayRecord();
isFound=1;
break;
}
file.read((char*)&e,sizeof(e));
}
char tempFile[]="temp.txt";
fstream temp(tempFile,ios::out|ios::binary);
if(isFound==0)
{
cout<<endl<<"Data not found for employee ID#"<<ID;
break;
}
else
{
file.clear();
file.seekg(0,ios::beg);
file.read((char*)&e,sizeof(e));
while(!file.eof())
{
if(e.GetID()!=ID)
temp.write((char*)&e,sizeof(e));
file.read((char*)&e,sizeof(e));
}
file.close();
temp.close();
temp.open(tempFile,ios::in|ios::binary);
file.open(fileName,ios::out|ios::binary);
temp.read((char*)&e,sizeof(e));
while(!temp.eof())
{
file.write((char*)&e,sizeof(e));
temp.read((char*)&e,sizeof(e));
}
}
temp.close();
file.close();
remove(tempFile);
file.open(fileName,ios::ate|ios::in|ios::out|ios::binary);
break;
case '7':
exit(0);
break;
default:
cout<<"Invalid Options";
}
cout<<"\nDo you want to continue.....?y/n";
cin>>ch;
}while(ch!='n');
}
OUTPUT
Figure 1: Main Menu of Employee Management System Using C++
Figure 2: Adding New Employee Record

Figure 3: Searching Employee record using Employee ID


Figure 4:List Employee of particular department

Figure 5:Display all employee record


Figure 6:Update record of employee
Figure 7:Deleting Existing Employee record

CONCLUSION

It was a great experience to design and implement the Employee


management System by using Object Oriented Programming language C++ and to
work on its documentation.While working on this project,we have learned many
things especially how to apply the concepts of OOP paradigm in modelling of real
world systems.
This assignment helped me to get the better understanding to develop and
derive new class structures and organise them such that they will model real world
systems within computers.It also helped me in getting in the better understanding
of basic programming concepts of C++ language such as loops,control
structure,arrays,file handling.
In this project,we have used almost every concepts of C++ language,we have
learned .We have also provided validations throughout the system for avoiding
logical errors,used excellent logic related comments with proper indentation and
the OOP’s concept in an excellent manner.
For any project to become successful there must be Teamwork,
Determination ,Co- ordination,Discipline,Hardwork,Time Management,Dedication
and Interest.We have followed all the aspects to make our project successful.We
have worked in team spirit.Due this project we have learned how to work in team
with proper Co-ordination.
After doing this project,We are in position to explain Object Oriented
Programming concepts and apply them to the modelling of real world systems by
utilizing its offered facilities.This will definitely help us in our society to apply the
concepts of programming in our real life to make work in easier manner.

Source
www.programiz.com
https://www.geeksforgeeks.org

You might also like