0% found this document useful (0 votes)
23 views

Computer Science Investigatory Project

The document describes a student project on an Employee Management System. It includes sections on the introduction, objectives of the project, hardware and software requirements, and the programming languages used. The project aims to computerize employee data and operations like adding, viewing, modifying, and deleting employee records.

Uploaded by

Vansh Tandon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Computer Science Investigatory Project

The document describes a student project on an Employee Management System. It includes sections on the introduction, objectives of the project, hardware and software requirements, and the programming languages used. The project aims to computerize employee data and operations like adding, viewing, modifying, and deleting employee records.

Uploaded by

Vansh Tandon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

COMPUTER SCIENCE

PRACTICAL
FILE

Modern Public
School
Submitted by:
Vansh Tandon
12th N
Roll no.-11632515

CERTIFICATE
This is hereby to cer fy that, the original and genuine inves ga on
work has been carried out to inves gate about the subject ma er
and the related data collec on and inves ga on has been completed
solely, sincerely and sa sfactorily by SAKSHAM KUMAR of Class XII
A, Kendriya Vidyalaya Jankpuri (First Shi ), regarding his project
tled “EMPLOYEE MANAGEMENT SYSTEM”.

Student’s Sign .Teacher’s Sign.


ti

ti
ti
ti

ti
ti
ft
ti

ti
ti
tt

ACKNOWLEDGEMENT
It would be my utmost pleasure to express my sincere thanks to my
Computer Science Teacher Mr. AJAY GODWAL SIR in providing a
helping hand in this project. Their valuable guidance, support and
supervision all through this project tled “EMPLOYEE MANAGEMENT
SYSTEM”, are responsible for a aining its present form.

I would like to thank her for teaching us computer science from the
very basics thus strengthening our root and making us understand
complex chapters easily.

This project has been made not only for fetching marks but also for
knowledge.

SAKSHAM KUMAR

XII A

tt
ti

CONTENTS
1. Introduc on

2. System Objec ves & Aim of the Project

3. Theory

4. Header Files Used

5. Source Code

6. Output Screens

7. Bibliography

ti

ti

INTRODUCTION
The purpose of the project is to computerize the requirement
of the EMPLOYEE MANAGEMENT SYSTEM and such to add an
employee, display the list of employees, search for an
employee, increase an employee’s salary, promo on for an
employee and delete an employee’s record. The
so waresaves mul ple employee records and gives op on
for every kind of modi ca on needed. It does almost every
work related to employee management purposesvia-

1) Add an employee
2) Display (All/Specific)
3) Salary Hike
4) Promo on
5) Dele ng an employee record

ft
ti
ti

ti

fi
ti

ti
ti
SYSTEM OBJECTIVES&
AIM OF THE PROJECT
Employee Management System which starts with a manual data
entry and management deals with many operations, now-a-
days has become a complicated and error prone job to maintain
the company’s administra ve system manually. So, we have
decided to go about computerizing their operation. The new system
created in the project i.e.

“Computeriza on of Employee ManagementSystem”


tends to computerize the Employee Management System by
storing its associated data in database files and thus performing all
works related to modification and implementation.

The main aim while implementing the project Employee


Management System were to minimize the work and at the same
time increase the speed of the work done. The new system is built
with the following objectives: -

•Information retrieval will become easy.


•Maintenance of database as well as overall project will become
easy.
•Modi ca on to the database will become easy.

fi
ti
ti

ti

HARDWARE REQUIREMENT

PROCESSOR Pen um III 500 MHz

HARD DISK DRIVE 2GB


RAM 64 MB

CACHE 512 KB

TOOLS/PLATFORM, LANGUAGE
TO BE USED
So ware and hardware speci ca on as the name suggests,

tells us about the various characteris cs of the so ware and

the hardware environment used i.e. the development

environment used. Here I specify various so ware languages,

suppor ng tools that have been used for the development of

the system. These tools and the languages have been used

because of their rela ve ease of understand and

personalinterest of the team developing the project.

SOFTWARE ENVIRONMENT
ft
ti
ti

ti
fi
ti
ti

ft

ft

OF PROJECT

PLATFORM WINDOW 8,10

FRONT END IDE Turbo C++

BACK END DOS le support

SOFTWARE LANGUAGES USED


In the development of a project the selec on of an

appropriate programming language and a pla orm is of

primary importance. The major part of credit of success of a

project goes to the so ware environment chosen by the

developer. Selec ng a language from the ocean of the

languages is very di cult. A developer has to consider the

various features and func onali es that a par cular language

can provide him/her how easily and successfully the

requirements of a user can be ful lled depend on the s/w


fi
ti

ffi
ft
ti
ti
fi
ti

tf
ti
language chosen. More over the developer also has to take

care of the various facili es, he can use. In the development

of this applica on, it has been taken into great considera on

that server overhead should be low as far as possible.

TURBO C++
It is one of the most widely used development tools on the

market today. C++ is a high-level, compilerandhigh

shelllanguage. In addi on, C++ has the feature of object-

oriented programming.

A language can be classi ed as low-level language and high-

level language. Program wri en in the low-level language is

dependent on the architecture of the computer. In other

words, the low-level languages are machine dependent.

Machine language and Assembly language are the low-level

languages. High-level language uses English like statements to


ti
ti

ti
fi
tt

ti
give an instruc on to the machine. These instruc ons are

machine independent. The same source program can be used

on another machine, which is architecturally di erent from

the machine in which the source program is wri en with a

few or no changes. In other words, the high-level languages

are machine independent. A high-level language has more

readability than low-level language. Programming in high-

level language is much easier than low-level language.


ti
ff
tt
ti

FEATURES OF HIGH
LEVEL LANGUAGE
A high-level language uses the translators to translate the

source program in to machine executable form because the

computer cannot understand the high-level language. It can

understand only binary language. A high-level language

program can be translated using interpreter or compiler.

Interpreter takes the source program line by line as input,

translates one line at a me into executable form if it has no

errors otherwise displays an error message. Compiler rst

translates the source program into object program if there is

no error; if there are errors in the program it displays the list

of the errors. A er transla ng the object program can be

executed. Each me the program execu on starts the

interpreter interprets the source program but compiler does


ft
ti
ti
ti
ti

fi
not. C++ is a compiler language. It also has the feature of

compila on. When one wants to create .exe le C++ rst

compile the source program then translates it into executable

program.

A language provides either low visual or high visual. Earlier

high-level languages like Pascal, Basic, For-Tran, COBOL, etc.

provides the low-visual because it uses the character-based

interface to interact with the user.

The C++ provide various facility like encapsula on and

polymorphism it also provides various features like excep on

handling mechanism it also provides run me object error

correc on.
ti
ti

ti
fi
ti
ti
fi
FEATURES OF C++

• It is a simple language that’s easy to master.

• C++ is a superset of C

• C++ makes working with the basic data types extremely

easy.

• C++ provides a full-featured development environment

with features such as polymorphism.

• The na ve code compiler provides the feature to build

fast, scalable components.

• Some facili es of C++ are inheritance, func on

overloading, operator overloading.

• C++ allows crea ng hierarchy related objects.

• C++ programs are easy to maintain and are also

expandable.

• C++ program is a collec on of func on.

• It gives us the ability to get close to the machine-level

details.

• This language provides clarity, incorpora ng the spirit

and e ciency of C.

• It is based on object-oriented programming structure.


ffi
ti

ti
ti

ti

ti

ti

ti

Basic concept of OOP’S

DATA ABSTRACTION:
Abstrac on refers to the act of represen ng essen al
features without including the background details or
explana on.

Example:
You are driving a car. You only know the essen al features to drive a car e.g.,
gear handling, steering handling, use of clutch, accelerator, brakes etc. But
while you are driving do you get into internal details of the car like wiring,
motor working etc.? You just change the gears of apply the brakes etc. What is
happening is hidden from you. This is abstrac on where you only know the
ti
ti

ti
ti
ti

ti
essen al things to drive a car without including the background details or
explana on. Another example is of ‘switch board’. You only press certain
switches according to your requirement. What is happening inside, how it is
happening inside, how it is happening etc. you needn’t know. Again, in this
abstrac on, you only know the essen al things to operate on the switch board
without the knowledge the background details of the switchboard.

DATA ENCAPSULAION:
The wrapping up of data and opera on/func on (that
operate on the data) into a single en ty (called class) is
known as encapsula on.

Example:
In a big company, there are so many departments, sales, account, payroll,
purchase, produc on etc. each department has its own personnel that
maintain its data. Suppose an employee in the produc on dept. wants to know
how much raw material has been purchased for the next month. The
produc on dept. employee would not be allowed to himself go throughthe
purchase dept. les. Rather, he`ll issue a memo to the purchase dept.
reques ng the desired informa on. Then some employee of the purchase
dept. will go through the data les for him and pertain to his requests. This
prac ce ensures that the data is accessed accurately and that it is not
corrupted by inept outsiders. Therefore, ‘Department data and department
employees are encapsulated into a single en ty, the department.’
ti
ti
ti
ti
ti
ti

fi
ti
ti

ti
fi

ti
ti
ti
ti
ti

ti

INHERITANCE:
Inheritance is the capability of one class of things to inherit
capabili es of proper es from another class.

Example:
‘Humans’ certain proper es, such as the ability to speak, breath, eat, drink, etc.
etc. But these proper es are not unique to humans. The class ‘Human’ inherits
these proper es from the class ‘Mammal’ which again inherits some of its
proper es from another “Animal’. The class “car” inherits some of its
proper es from the class ‘Automobiles” which inherits some of its proper es
from another class ‘Vehicles”. The capability to pass down proper es is a
powerful one. It allows us to describe things in an economical way.
‘Automobiles and ‘Pulled Vehicles’ are subclasses of ‘Vehicles’. ‘Vehicles are
base class of ‘Automobiles’ and ‘Pulled Vehicles’.

MODULARITY (CLASSES & OBJECT):


Modularity is the property of a system that has been
decomposed into a set of cohesive and loosely coupled
modules.

Example:
You must have seen a complete music system. Let us assume that our program
represents the music system. The music system comprises of speakers,
casse e-player, record-player, cd-player, tuner etc. Now, these parts are
complete units in themselves, yet they are themselves, yet they are a subpart
of the music system. This is modularity. Similarly, we can achieve modularity in
tt
ti
ti

ti

ti

ti
ti
ti

ti
ti
programs also. A program can be divided into various modules each
represen ng speakers, casse e-player… etc. See each module is a complete
unit itself yet it works in accordance with other modules in order to achieve
one single goal i.e. music.

POLYMORPHISM:
Polymorphism is the ability for a message or data to be
processed in more than one form.

Example:
‘Human’ is a subclass of ‘Mammal’. Similarly ‘Dog’, ‘Cat’, are also subclasses of
‘Mammals’. Mammals can see through day-light. So if a message ‘see through
day light’ is passed to all mammals, they will behave alike. Now if a message
‘see through day light’is passes to all mammals, then humans and dogs will not
be able to see at night whereas cat will be able to see at night also. Here cats
behave di erently than other mammals in response to a message or ac on.

FILE HANDLING
ti
ff

tt

ti

We know that Files are used for Storing Permanent informa on. And
C++ provides a Facility to a developer the Retrieve the Informa on
from File and he may also modify the Contents of a File So that we
can say that File Handling is the Concept to Store, Retrieve and
Modify the Informa on which is stored in the Form of Files in your
Computer.

There are Many Built in Classes of C++, Which Provides Various


Func onality for Performing the Opera ons on Files. A user has an
Ability to Modify the data of a File With the help of these Func ons.
Generally, a user can use a File Read, Write or For Appending More
data into the File so that C++ Provides Various Classes For Performing
these Opera ons. There are two most important Classes which are
known as ifstream and ofstream. Ifstream stands for input Stream
which is used for Reading the Contents from a File and output Stream
or Simply ofstream is used for wri ng data into the Files.

There is one More Class Which is used for Both Performing read
and write known as fstream class and Always Remember for using
Any Class First we have to use or include a header le which is called
as Fstream.h header le.

Various Func ons for Reading and wri ng data of Files


ti

ti
ti
ti
fi

ti
ti
ti
fi

ti
ti
ti
1) get: - This Func ons Stands for Reading data from a File in the
Form of Character.

2) Put:- This Func on is used for Wri ng the data into a File in the
Form of Characters

3) << and >> These Operators are also used for Wri ng the data into
the File, The Data may int, oat or any other data type. << Operator is
used for Wri ng data into a File and >> Operator is used for Reading
data from a File.

4) Read and Write: - With the help of C++ one can also Read or Write
the Data from a le. But C++ also Provides a Write Method or
Func on for Wri ng the data of A Class into a File Like Data of a
Member Func ons, Values of data Members of a Class and One Can
Also Read the Informa on once this wri en into a File with the help
of Read Method or Func on.

HEADER FILES USED


ti
ti
ti
ti

ti

fi

ti
ti
ti
fl

ti
tt
ti

1. #include<iostream.h>

2. #include<fstream.h>

3. #include<stdio.h>

4. #include<conio.h>

5. #include<stdlib.h>

6. #include<string.h>

SOURCE
CODE

#include<iostream.h>
#include<fstream.h>
#include<stdio.h>

#include<conio.h>
#include<stdlib.h>
#include<string.h>
class Employee //declaring class employee
{ private:
intcode; //data members
char name[40];
char post[20];
oat salary;

public: //member func ons


void read();
void display();
intgetEmpCode() //will return employee code
{ return code;
}

oat getSalary() //will return employee salary


{ return salary;
}

void updateSalary( oat s) //will update employee salary


{ salary = s;
}
void updatePost(char str[]) //will change post of an employee
{ strcpy(post,str);
}

















fl
fl

fl

ti

};

void Employee::read() //Read employee record


{ cout<<"\nEnter employee code: ";
cin>>code;
cout<<"Enter name: ";
gets(name);
cout<<"Enter designa on: ";
gets(post);
cout<<"Enter salary: ";
cin>>salary;
}

void Employee::display() //Display employee record


{
cout<<"\t"<<code<<"\t\t"<<name<<"\t"<<post<<"\t"<<salary<<"\n";

void welcome() //func on for welcome screen


{ clrscr();
gotoxy(28,7);
cprin ("W E L C O M E T O");
gotoxy(25,9);
cprin ("EMPLOYEE MANAGEMENT SYSTEM");
gotoxy(32,12);
cprin ("COMPILED BY:");

tf
tf
tf

ti

ti

gotoxy(32,13);
cprin ("SAKSHAM KUMAR");
gotoxy(35,14);
cprin ("XII A");
gotoxy(19,15);
cprin ("KENDRIYA VIDYALAYA JANAKPURI (FIRST SHIFT)");
gotoxy(24,19);
cprin ("*Press any Key for Main Menu*");
getch();
}

fstream le; //global declara on

void appendToFile() //func on to append record into le


{ gotoxy(25,1);
cprin ("EMPLOYEE MANAGEMENT SYSTEM");

Employee x;
x.read(); //Read employee record from user
le.open("EMPLOYEE.DAT",ios::binary|ios::app);
if(! le)
{ cout<<"\nERROR IN CREATING FILE\n";
return;
}
cout<<endl;
//write into le
le.write((char*) &x,sizeof(x));
fi

fi

tf
tf
tf
tf
tf
fi

fi

fi

ti

ti

fi

le.close();
cout<<"Record added sucessfully \n";
}

void displayAll() //Display all records


{ gotoxy(25,1);
cprin ("EMPLOYEE MANAGEMENT SYSTEM");

Employee x;

le.open("EMPLOYEE.DAT",ios::binary|ios::in);
if(! le)
{ cout<<"ERROR IN OPENING FILE \n";
return;
}
cout<<"\nEmpCode"<<"\tName"<<"\tDesigna on"<<"\tSalary \n";
while(! le.eof())
{ if( le.read((char*) &x,sizeof(x)))
x.display();
}
le.close();
}

void searchForRecord() //read employee id


{ gotoxy(25,1);
cprin ("EMPLOYEE MANAGEMENT SYSTEM");
Employee x;
fi
fi

fi

fi
tf
tf
fi

fi

ti

intn;
int ag=0;

cout<<"\nEnter employee code: ";


cin>>n;

le.open("EMPLOYEE.DAT",ios::binary|ios::in);
if(! le)
{ cout<<"ERROR IN OPENING FILE \n";
return;
}
while(! le.eof())
{ if( le.read((char*) &x,sizeof(x)))
{ if(x.getEmpCode()==n)
{cout<<"RECORD FOUND\n";
cout<<"EmpCode"<<"\tName"<<"\tDesigna on"<<" \tSalary\n";
x.display();
ag=1;
break;
}
}
}

if( ag==0)
{ cout<<"Record not found with employee code "<<n;
}
le.close();
fi
fi
fl

fl
fi

fl
fi

fi

ti

void increaseSalary() //Func on to increase Salary


{ gotoxy(25,1);
cprin ("EMPLOYEE MANAGEMENT SYSTEM");
Employee x;
intn, ag=0;
oat newsal, sal;
long pos;

cout<<"\nEnter Employee Code: ";


cin>>n;

le.open("EMPLOYEE.DAT",ios::binary|ios::in|ios::out);
if(! le)
{ cout<<"ERROR IN OPENING FILE \n";
return;
} //Using File handling concepts
while(! le.eof())
{ pos= le.tellg();
le.read((char*) &x,sizeof(x));
{ if(x.getEmpCode()==n)
{ cout<<"Enter Salary hike: ";
cin>>sal;
newsal=x.getSalary() + sal;
x.updateSalary(newsal);
le.seekg(pos);
fi








fl

fl
tf
fi
fi




fi

fi
fi

ti

le.write((char*) &x,sizeof(x));
ag=1;
break;
}
}
}
if( ag==1)
{ cout<<"\nNew Salary: "<<newsal;
cout<<"\nSalary Updated Successfully\n";
}
else
cout<<"Record not found with employee code "<<n;
le.close();
}

void promo on() //To give new post to an employee


{ gotoxy(25,1);
cprin ("EMPLOYEE MANAGEMENT SYSTEM");
le.open("EMPLOYEE.DAT",ios::binary|ios::in|ios::out);
if(! le)
{ cout<<"ERROR IN OPENING FILE \n";
return;
}

Employee x;
intn, ag=0;
char str[20];







fi
fi

fl
fl
tf
fi



fi
fl

ti

long pos;
cout<<"\nEnter employee code: ";
cin>>n;

while(! le.eof())
{ pos= le.tellg();
le.read((char*) &x,sizeof(x));
if(x.getEmpCode()==n)
{ cout<<"Enter new post name: ";
gets(str);
x.updatePost(str);
le.seekg(pos);
le.write((char*) &x,sizeof(x));
ag=1;
break;
}
}
if( ag==1)
cout<<"Promo on done successfully \n";
else
cout<<"Record not found with employee code "<<n;
le.close();
}

void delRecord() //delete an employee record


{ gotoxy(25,1);
cprin ("EMPLOYEE MANAGEMENT SYSTEM");










fi

fl
tf
fi
fi
fi

fi
fl

fi

ti

Employee x;
intn, ag=0;
cout<<"\nEnter employee code: ";
cin>>n;
fstream n;
le.open("EMPLOYEE.DAT",ios::binary|ios::in); //Input Mode
n.open("TEMP.DAT",ios::binary|ios::out); //Write Mode

while( le.read((char*) &x, sizeof(x)))


{ if(x.getEmpCode()!=n)
n.write((char*) &x, sizeof(x));
else
ag=1;
}
le.close();
n.close();

if( ag==1)
cout<<"\nRecord Deleted Successfully";
else
cout<<"\nRecord not found with Emp Code "<<n;

remove("EMPLOYEE.DAT");
rename("TEMP.DAT","EMPLOYEE.DAT");
}
fi
fi


fi
fi

fl
fl
fi
fl

fi
fi

void main()
{ welcome();
clrscr();
char ch;

do
{ gotoxy(25,1);
cprin ("EMPLOYEE MANAGEMENT SYSTEM");
int n;
cout<<"\nPress 0 for exit \n"; //Menu for di erent opera ons
cout<<"1.ADD AN EMPLOYEE \n";
cout<<"2.DISPLAY ALL \n";
cout<<"3.SEARCH SPECIFIC \n";
cout<<"4.INCREASE SALARY \n";
cout<<"5.PROMOTION \n";
cout<<"6.DELETE A RECORD \n";
cout<<"Make a choice: ";
cin>>n;

if(n==0)
exit(0);

else
{ clrscr();
switch(n) //di erent cases in menu driven program
{

tf

ff

ff
ti

case 1: appendToFile(); break;


case 2: displayAll(); break;
case 3: searchForRecord(); break;
case 4: increaseSalary(); break;
case 5: promo on(); break;
case 6: delRecord(); break;
default: cout<<"Invalid Choice\n";
}
}
cout<<"\n\nDo you want to con nue? (Press Y/y to con nue): ";
cin>>ch;
clrscr();
} while(ch=='Y'||ch=='y');
}







ti

ti

ti

OUTPUT
SCREENS

WELCOME SCREEN

MAIN MENU

ADDING A NEW
EMPLOYEE

DISPLAYING ALL
RECORDS

SEARCHING A SPECIFIC
RECORD

INCREASING SALARY

UPDATED RECORDS

PROMOTION

UPDATED RECORD

DELETING A RECORD

UPDATED RECORD

WHEN A WRONG
INPUT IS GIVEN

WHEN A WRONG
EMPLOYEE CODE IS
GIVEN FOR OPERATIONS

BIBLIOGRAPHY
1. COMPUTER SCIENCE text book
By: SUMITA ARORA

2. Mr. AJAY GODWAL sir


(P.G.T. Comp. Science)

3. SHIV DAS ques on bank in C++.

4. K.V.S. Study Material for Computer Science

5. www.cppforschool.com
ti

You might also like