SHRI SAI POLYTECHNIC,
CHANDRAPUR
MINI PROJECT ON
“EMPLOYEE RECORD SYSTEM”
SUBJECT: OBJECT ORIENTED PROGRAMMING
DEPARTMENT OF COMPUTER ENGINEERING
(SECOND YEAR)
ACADEEMI SESSION 2021-2022
SUBMITTED BY
1. KARAN NAGRALE
2. NAYAN KASWATE
3. SHIVAM PULI
4. PRITI SATUTE
GUIDED BY H.O.D
Prof.S.M.MOREY Prof.S.SARKATE
INTRODUCTION
The objective of this assignment is to be Win32 consol application for an
EMPLOYEE RECORD SYSTEM, whereit is expected to enter, search, edit and
view personnel information of the Employee in an Organization based on
different access priority and calculate their salary package.
We are required design the application by assuming that, this system will be
installed only in one terminal and used by all types of users, specifically the
Employee and the administrator of this application.The main purpose of this
application is to store and edit the complete personal record of each Employee
along with evaluation of salary (annually) in an organization. And all
information that is to be added and edited must be handled via test (.txt)
or data (.dat) file, so that the information can be uploaded back into the
system once activated or saved when the system is exited.
We are also required to incorporate the Validation throughout the application
for each entry, from the user in order to avoid logical errors.
We are supposed to describe, justify and implement an object oriented system
by the application,
Introduce current technical issues in the field of object oriented programming
(OOP). Thus, predominantly our implementation coe is expected to highlight
the use of object oriented programming principles (OOPs) such as:
Class
Abstraction
Inheritance
Polymorphism
PROJECT DESCRIPTION
The project is evaluated deeply and it is discovered that, this project
contains certain modules that needs to be incorporated in the system design.
So, for getting the better understanding of the project, these modules are
described below-
1. Login Module
It is one of the most important modules of the Employee Record System.
Each Employee of the system has to be assigned it’s own user name and
password. And the assigning job is to performed by the administrator.
The login module chiefly contains:
Administrator Login
Employee Login
2. Administrator Modul
The administrator of the application has to be provided the highest
access priority which enable his/her to perform all the functionalities
that exist in the application. In addition to that, the administrator is able
to register Employee.
The administrator is allowed to:
Register Employee as users of the system.
Add, search and edit personal information of Employee.
Delete record of any Employee.
Calculate salary package of Employees.
3. Employee Module
The Employee in this application has the lowest accesss priority that only
enables him/her to only view the personal information and the annual
salary.
4. Identification Card (IC) Number Generation Module
Each employee in the application has to be assigned with it’s unique
Identification Card (IC) Number by which the employee can be identified
uniquely for the operations and this is automatically generated by the
system.
5. Record Searching Module
The searching of any record in the system must be done by using the
following categories:
IC Number
Designation
Department
SOURCE CODE
Employee Record System with Source Code is a project that manage your
employee data within the company. The system will take care of your
employee data by entering their First Name, Last Name, Age, Salary. The
purpose of the system is to help you organize and maintain the record for each
employee that have been working in a company.
About the System
The Employee Record System was created in a simple console application, the
system is openly accessed you do not need to enter such as usarname and
password. The user can to do many things in the system he/she can add new
employee, update existing employee data, remove unnecessary employee
data. Using this system it will make you sure that the data you inputted will be
safely secure and it will help you rack you current employee data. The
Employee Record System was build in a simple coding structure of C++
programming language that can help you understand the flow of this system.
Features:
Can Add new Employee
Modify Existing Data
Can View All the Data List
Remove Current Data
The Employee Record System was developed using only C++ language. I hope
that this system can help to what you looking for. For more updates and
tutorials just kindly visit this site.
PROGRAMMING CODE
#include<iosteram.h>
#include<conio.h>
Class Emloyee
{
int code;
char name[20];
float salary;
Public:
void read();
void display();
int get emp_code()
int get salary ()
void (float s)
};
Void employee::read()
{
cout<<”Enter employee code:”;
cin>>code;
cout<<”Enter employee name:”;
cin>>name;
cout<<”Enter salary:”;
cin>>salary;
}
void Employee ::display()
{
cout<<code<<”\n “<<name<<”\t”<<salary<<endl;
}
Void delete Existing File()
{
remove(“Employee.DAT”);
}
Void append To File()
{
Employee x;
x.read ();
file.open(“Employee.DAT”,ios:: binary\ios::app);
if(!file)
{
cout<<”ERROR IN CRETING FILE \n”;
return ();
}
file.write((char*)&x,sizeof(x));
file.close ();
cout<<”Record added successfully \n”;
}
void display All()
{
Employee x;
File.open(“Employee.DAT”,ios::binary\ios::in);
if (!file)
{
cout<<”ERROR IN OPENING FILE \n”;
retuen();
}
while(file)
{
if(file.read((char*)&x,sizeof(x)))
if(x.getSalary()>=10000&&x.getSalary()<=20000)
x.display();
}
file.close();
}
void searchForRecord()
{
Employee .x
int c;
int isFound=0;
cout<<”Enter employee code :”;
cin>>0;
file.open(“EMPLOYEE.DAT”,ios::binary\ios::in);
if(!file)
{
cout<<”ERROR IN OPENING FILE \n”;
return();
}
while(file)
{
If(file.read((char*)&x,sizeof(x)))
{
if(x.getEmpCode()==c)
{
cout<<”RECORD FOUND \n”;
x.display();
isFound=1;
break;
}
}
}
if(isFound==0)
{
Cout<<’Record not Fund!!! \n”;
}
File.close ():
}
Void increase Salary()
{
Employee x;
int c;
int is Found =0;
float sal;
cout<<”Enter employee code \n”;
cin>>c;
file.open(“EMPLOYEE.DAT”,ios::binary\ios::in);
if(!file)
{
cout<<”ERROR IN OPENING FILE \n”;
return ();
}
While(file)
{
If(file.read((char*)&x,sizeof(x)))
{
If(x.getEmpCode()==c)
{
Cout<<”Salary hike?”;
Cin>>sal;
x.updateSalary(x.getSalary()+sal);
isFound=1;
break;
}
}
}
If(isFound==0)
{
Cout<<”Record not found!!! \n”;
}
File.close();
Cout<<”Salary update successfully “<<endl;
}
Void insertRecord()
{
Employee x;
Employee newEmp;
newEmp.read();
fstream fin;
file.open(“EMPLOYEE.DAT”,ios::binary\ios::in);
fin.open(“TEMP.DAT”,ios::binary\ios::out);
if(!file)
{
Cout<<”Error in opening EMPLOYEE.DAT file!!! \n”;
return();
}
If(!fin)
{
Cout<<”Error in opening TEMP.DAT file!!! \n;
Return();
}
While(file)
{
If(file.read((char*)&x,sizeof(x)))
{
If(x.getEmpCode()>newEmp.getEmpCode())
{
Fin.write((char*)&newEmp,sizeof(newEmp)):
}
Fin.write((char*)&x, sizeof(x));
}
}
Fin.close ();
Fin.close();
Rename(“TEMP.DAT”,”EMPLOYEE.DAT”);
Rename(“TEMP.DAT”);
Cout<<”Record inserted successfully”<<endl;
}
Int main()
{
Char ch;
deleteExistingFile();
do
{
Int n;
Cout<<”ENTER CHOICE \n”<<”1. ADD AN EMPLOYEE \n”<<”2. DISPLAY \n”<<”
3. SEARCH \n”<<”4. SNCREASE SALARY\n”<<”5. INSERT RECORD \n”;
Cout<<”Make a choice:”;
Cin>>n;
Switch(n)
{
case 1:
appendToFille();
break;
case 2:
displayAll();
break;
case 3:
searchForRecord();
break;
case 4:
increaseSalary();
break;
case 5:
insertRecord();
break;
default:
cout<<”Invalid choice \n”;
}
Cout<<”Do you want to continue ?:”;
Cin>>ch;
}
While(ch==’Y’\\ch==’y’);
Return 0;
}
OUTPUT
ENTER CHOICE
1. ADD AN EMPLOYEE
2. DISPLAY
3. SEARCH
4. INCREASE SALARY
5. INSERT RECORD
Make a choice: 1
Enter employee code : 101
Enter name : ujwal
Enter salary 19000
Record added sucessfully
Do you want to continue ? : Y
CONCLUSION
It was a great experience to desin and implement the Employee Recod
System by using an Object Oriented Programming Language C++ and to work
on it’s documentation. While working on this project, I 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 etc.
In this assignment, I have used almost every concepts of C++ language, I had
learned. I have also provided validations throughout the system for avoiding
logical errors, used excellent logic related comments with proper indentation
and the OOPs concept in an excellent manner.
After doing this assignment, I am in position to explain object orinted
programming concepts and apply them to the modelling of real world system
by utilizing its offered facilities.
REFERENCES
1. Chandrapur, S.2021, Computer Science with C++, 6th ed., Chandrapur.
2. Object Oriented Programming Concepts in C++. 2014 .Object Oriented
Programming Concepts in C++.[ONLINE] Available at:
http://www.studytonight.com/cpp/cpp-and-opps-concepts.php.[Accessed
20 December 2021].
3. E Balagurusamy, A.E.1994,Object Oriented Programming with C++ Third
Edition,McGraw-hill, London.
INDEX
1. Indroduction
2. Project Description
3. Source Code
4. Programming Code
5. Output
6. Reference and Conclusion