Computer Science Investigatory Project
Computer Science Investigatory Project
INVESTIGATORY
PROJECT
Kendriya Vidyalaya
NO.1 (1 SHIFT)
ST
Submitted by:
SWANSI SRIYA PAGAD
12 B
th
1
CERTIFICATE
This is hereby to certify that, the original and genuine investigation
work has been carried out to investigate about the subject matter
and the related data collection and investigation has been completed
solely, sincerely and satisfactorily by SWANSI SRIYA PAGAD of Class
XII B,
Kendriya Vidyalaya No.1 (First Shift), regarding his project titled
“EMPLOYEE MANAGEMENT SYSTEM”.
2
ACKNOWLEDGEMENT
It would be my utmost pleasure to express my sincere thanks to my
Computer Science Teacher Mrs. KAVITA HAZRA in providing a
helping hand in this project. Their valuable guidance, support and
supervision all through this project titled “EMPLOYEE
MANAGEMENT SYSTEM”, are responsible for attaining 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.
XII B
3
CONTENTS
1. Introduction
2. System Objectives & Aim of the Project
3. Theory
4. Header Files Used
5. Source Code
6. Output Screens
7. Bibliography
4
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, promotion for an
employee and delete an employee’s record. The softwares
are multiple employee records and gives option for every
kind of modification needed. It does almost every work
related to employee management purposes are -
1) Add an employee
2) Display (All/Specific)
3) Salary Hike
4) Promotion
5) Deleting an employee record
5
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 administrative system manually. So,
we have decided to go about computerizing their operation.
The new system created in the project i.e.
6
HARDWARE REQUIREMENT
PROCESSOR Pentium III 500 MHz
RAM 64 MB
CACHE 512 KB
TOOLS/PLATFORM, LANGUAGE
TO BE USED
Software and hardware specification as the name suggests,
the system. These tools and the languages have been used
7
SOFTWARE ENVIRONMENT
OF PROJECT
PLATFORM WINDOW 8,10
8
requirements of a user can be fulfilled depend on the s/w
TURBO C++
It is one of the most widely used development tools on the
programming.
9
A language can be classified as low-level language and high
10
FEATURES OF HIGH
LEVEL LANGUAGE
A high-level language uses the translators to translate the
11
executed. Each time the program execution starts the
executable program.
correction.
12
FEATURES OF C++
• C++ is a superset of C
easy.
13
• The native code compiler provides the feature to build
expandable.
details.
and efficiency of C.
14
Basic concept of OOP’S
DATA ABSTRACTION:
Example:
You are driving a car. You only know the essential 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
15
happening is hidden from you. This is abstraction where you only know the
essential things to drive a car without including the background details or
explanation. 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
abstraction, you only know the essential things to operate on the switch board
without the knowledge the background details of the switchboard.
DATA ENCAPSULAION:
The wrapping up of data and operation/function (that
operate on the data) into a single entity (called class) is
known as encapsulation.
Example:
In a big company, there are so many departments, sales, account, payroll,
purchase, production etc. each department has its own personnel that
maintain its data. Suppose an employee in the production dept. wants to know
how much raw material has been purchased for the next month. The
production dept. employee would not be allowed to himself go through the
purchase dept. files. Rather, he`ll issue a memo to the purchase dept.
requesting the desired information. Then some employee of the purchase
dept. will go through the data files for him and pertain to his requests. This
practice 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 entity, the department.’
16
Inheritance is the capability of one class of things to inherit
capabilities of properties from another class.
Example:
‘Humans’ certain properties, such as the ability to speak, breath, eat, drink, etc.
etc. But these properties are not unique to humans. The class ‘Human’ inherits
these properties from the class ‘Mammal’ which again inherits some of its
properties from another “Animal’. The class “car” inherits some of its
properties from the class ‘Automobiles” which inherits some of its properties
from another class ‘Vehicles”. The capability to pass down properties 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’.
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,
cassette 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
programs also. A program can be divided into various modules each
17
representing speakers, cassette-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 differently than other mammals in response to a message or action.
FILE HANDLING
We know that Files are used for Storing Permanent information. And
C++ provides a Facility to a developer the Retrieve the Information
from File and he may also modify the Contents of a File So that we
18
can say that File Handling is the Concept to Store, Retrieve and
Modify the Information which is stored in the Form of Files in your
Computer.
There is one More Class Which is used for Both Performing read
and write known as of stream class and Always Remember for using
Any Class First we have to use or include a header file which is called
as of stream header file.
1) get: - This Functions Stands for Reading data from a File in the
Form of Character.
19
2) Put :- This Function is used for Writing the data into a File in the
Form of Characters
3) << and >> These Operators are also used for Writing the data
into the File, The Data may int, float or any other data type. <<
Operator is used for Writing 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 file. But C++ also Provides a Write Method or
Function for Writing the data of A Class into a File Like Data of a
Member Functions, Values of data Members of a Class and One Can
Also Read the Information once this written into a File with the help
of Read Method or Function.
20
HEADER FILES USED
1. #include<iostream.h>
2. #include<fstream.h>
3. #include<stdio.h>
4. #include<conio.h>
5. #include<stdlib.h>
6. #include<string.h>
21
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:
Int code; //data
members char name[40];
char post[20]; float salary;
22
void read(); void display(); intger Emp Code()
//will return employee code
{ return code;
}
23
}
Employee x;
x.read(); //Read employee record from user
file.open("EMPLOYEE.DAT",ios::binary|ios::app); if(!
file)
24
{ cout<<"\nERROR IN CREATING FILE\n";
return;
}
cout<<endl;
//write into file file.write((char*) &
x, size of(x)); file.close();
cout<<"Record added sucessfully \n";
}
Employee x;
file.open("EMPLOYEE.DAT",ios::binary|ios::in); if(!
file)
{ cout<<"ERROR IN OPENING FILE \n";
return;
}
cout<<"\nEmpCode"<<"\tName"<<"\tDesignation"<<"\tSalary \n";
while(!file.eof())
{ if(file.read((char*) &x,sizeof(x)))
x.display();
}
file.close();
}
25
{ got oxy(25,1);
print("EMPLOYEE MANAGEMENT SYSTEM");
Employee x;
int; int flag=0;
file.open("EMPLOYEE.DAT",ios::binary|ios::in); if(!
file)
{ cout<<"ERROR IN OPENING FILE \n";
return;
}
while(!file.eof())
{ if(file.read((char*) &x,sizeof(x)))
{ if(x.getEmpCode()==n) {cout<<"RECORD FOUND\n";
cout<<"EmpCode"<<"\tName"<<"\tDesignation"<<" \tSalary\n";
x.display(); flag=1; break;
}
}
}
if(flag==0)
{ cout<<"Record not found with employee code "<<n;
}
file.close();
}
26
cprintf("EMPLOYEE MANAGEMENT SYSTEM");
Employee x;
intn,flag=0; float
newsal, sal; long
pos;
file.open("EMPLOYEE.DAT",ios::binary|ios::in|ios::out); if(!
file)
{ cout<<"ERROR IN OPENING FILE \n";
return;
} //Using File handling concepts while(!
file.eof())
{ pos=file.tellg();
file.read((char*) &x,sizeof(x));
{ if(x.getEmpCode()==n)
{ cout<<"Enter Salary hike: ";
cin>>sal;
newsal=x.getSalary() + sal;
x.updateSalary(newsal);
file.seekg(pos); file.write((char*)
&x,sizeof(x));
flag=1;
break;
}
}
}
27
if(flag==1)
{ cout<<"\nNew Salary: "<<newsal; cout<<"\
nSalary Updated Successfully\n";
}
else
cout<<"Record not found with employee code "<<n; file.close();
}
while(!file.eof())
{ pos=file.tellg();
file.read((char*) &x,sizeof(x));
if(x.getEmpCode()==n)
{ cout<<"Enter new post name: ";
gets(str);
28
x.updatePost(str);
file.seekg(pos); file.write((char*)
&x,sizeof(x)); flag=1; break;
}
}
if(flag==1)
cout<<"Promotion done successfully \n";
else
cout<<"Record not found with employee code "<<n; file.close();
}
void delRecord() //delete an employee record
{ got oxy(25,1);
cprintf("EMPLOYEE MANAGEMENT SYSTEM");
if(flag==1)
29
cout<<"\nRecord Deleted Successfully";
else
cout<<"\nRecord not found with Emp Code "<<n;
remove("EMPLOYEE.DAT"); rename("TEMP.DAT","EMPLOYEE.DAT");
}
void main() {
welcome();
clrscr();
char ch;
do
{ gotoxy(25,1); cprintf("EMPLOYEE MANAGEMENT SYSTEM"); int
n; cout<<"\nPress 0 for exit \n"; //Menu for different
operations 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) //different cases in menu
driven program
{
case 1: appendToFile(); break; case
2: displayAll(); break; case 3:
30
searchForRecord(); break; case 4:
increaseSalary(); break; case 5:
promotion(); break; case 6:
delRecord(); break; default:
cout<<"Invalid Choice\n";
}
}
cout<<"\n\nDo you want to continue? (Press Y/y to continue): ";
cin>>ch; clrscr();
} while(ch=='Y'||ch=='y');
}
31
OUTPUT
SCREENS
32
WELCOME SCREEN
33
MAIN MENU
ADDING A NEW
EMPLOYEE
34
DISPLAYING ALL
RECORDS
35
SEARCHING A SPECIFIC
RECORD
36
INCREASING SALARY
UPDATED RECORDS
37
PROMOTION
38
UPDATED RECORD
DELETING A RECORD
39
UPDATED RECORD
40
WHEN A WRONG
INPUT IS GIVEN
41
WHEN A WRONG
EMPLOYEE CODE IS
GIVEN FOR OPERATIONS
42
BIBLIOGRAPHY
1. COMPUTER SCIENCE text book
By: SUMITA ARORA
43
4. K.V.S. Study Material for Computer Science
5. www.cppforschool.com
44
45
46