Вы находитесь на странице: 1из 31

1 MINOR PROJECT

EMPLOYEE MANAGEMENT SYSTEM

A Minor Project Report


Submitted in partial fulfilment of the requirements for the
Award of degree of Bachelor of Computers Application
(BCA)

2015-2018

Submitted by Guided by
RISHABH REHANI Mr. A.K-Srivastav
0151BCA043

Bharati Vidyapeeth Deemed University Institute of Management & Research

New Delhi-63

2016

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
2 MINOR PROJECT

Acknowledgement

I would like to express my gratitude and appreciation to all those who


gave me the possibility to complete this report. A special thanks to our
minor project coordinator Mr. A.K-Srivastav, Help stimulating
suggestion and encouragement helped me to Coordinate my project
especially in writing this report.last but not the least many thanks go
to my project guide Mr. A.K-Srivastav who have given her full
effort in guiding the team in achieving the goal as well as her
encouragement to maintain our progress in track. I would like to
appreciate the guidance given by other supervisor as well as the
panels especially in our project presentation that has improved our
presentation skills by their comments and tips.

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
3 MINOR PROJECT

CERTIFICATE OF ORIGINALITY

This is to certify that the project titled submitted to Bharati Vidyapeeth


Deemed University, Pune in partial fulfilment of the requirement for the
award of the degree of Bachelor of Computer Application is an original
work carried out under the guidance of Mr. A.K-Srivastav The matter
embodied in this project is a genuine work done by me and has been submitted
neither to this University nor to any other University for the fulfillment of the
requirement of the course of study.

Signature of the student

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
4 MINOR PROJECT

CERTIFICATE OF ORIGINALITY

This is to certify that the Project titled is an academic work done by RISHABH
REHANI submitted in the partial fulfilment of the requirement for the award
of the Degree of Bachelor of Computer Application from Bharati
Vidyapeeth Deemed University, Pune under my guidance & direction. To
the best of my knowledge and belief the data & information presented by
him/her in the project has not been submitted earlier.

Mr. A.K-Srivastav

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
5 MINOR PROJECT

DECLARATION

This report titled "Employee Management system" is being submitted by us


the partial fulfillment of requirements for the award of degree of Bachelor of
Computer Application (B.C.A.) from Bharati Vidyapeeth University,
Pune.

I have not submitted this work anywhere else for any other degree or diploma.
All sources of information and help are authentic and have been acknowledged
in the report.

RISHABH REHANI

BCA I Year (2nd SEM)

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
6 MINOR PROJECT

INTERNAL CERTIFICATE

This is to certify that dissertation entitled "Employee Management system"


submitted by Rishabh rehani for the award of the degree of Bachelor of
Computer Application from, Bharati Vidyapeeth University, Pune.

Mr. A.K-Srivastav

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
7 MINOR PROJECT

Employee management system

Employee management system makes it easy to check and track human


resources department at the click of a button.

Key features:

Add mange employee

Manage employee personal details

Add manage employee designation

View, edit employee salary system

Search employee details with name

Minimum Hardware Requirement

Processor : Dual core and above

RAM : 1 GB and above

Hard Disk Utilization : 40 GB and above

Input Devices : Mouse, Keyboard, etc

Output Devices : Monitor, Printer, etc

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
8 MINOR PROJECT

Minimum Software Requirement

Operating System : Any

Front-end : C language

Back-end : C language

IDE : bloodshed dev c++

Problem definition

The problem definition for designing the system is to maintain data of


employee and to make easy controlling employees.

To eliminate or reduce as much as possible the hardships of existing


system.

To avoid errors while entering data.

No formal knowledge is needed for user to use the system.

The whole system is completely protected.

Modules Implemented/Designed

There are six modules in this system :

Add Record

List Record

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
9 MINOR PROJECT

Modify Record

Delete Record

Search Record

Close Record

Add Record : Addition of records must always take place at the end of
existing records in the file.

List Record : Listing records means displaying the existing records on the
screen.

Modify Record: While modyfing records, first we must ask the user
which record he intends to modify. On modifying the record, the existing
record gets overwritten by the new record.

Delete Record:

a) In deleting records, except for the record to be deleted, rest of the


records must first be written to a temporary file.

b) Then the original file must be deleted and the temporary file must be
renamed back to original.

c) Search_Record: In searching records, search the particular record which


is inputed by the user.

d) Close_Record : File is being opened only once and closed only once.

e) System(cls) function call clears the contents of the screen.

f) gotoxy() function places the cursor at appropriate position on the


screen.

g) fread() always reads that record where the pointer is currently placed.

h) fwrite() always writes the record where the pointer is currently placed

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
10 MINOR PROJECT

i) The rewind() function places the pointer to the beginning of the file,
irrespective of where it is present right now.

j) The fseek() function moves the pointer from one record to another.

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
11 MINOR PROJECT

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
12 MINOR PROJECT

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
13 MINOR PROJECT

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
14 MINOR PROJECT

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
15 MINOR PROJECT

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
16 MINOR PROJECT

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
17 MINOR PROJECT

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
18 MINOR PROJECT

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
19 MINOR PROJECT

CODING

/*

* A menu-driven program for elementary database management

* @language: C

* This program uses file handling in Binary mode

*/

//List of library functions

#include<stdio.h>

#include<stdlib.h>

#include<conio.h>

#include<string.h>

#include<dos.h>

/** List of Global Variable */

char password[10]={"hello"};

void Password(void) //for password option

char d[25]="Password Protected";

char ch,pass[10];

int i=0,j;

clrscr();

gotoxy(10,4);

for(j=0;j<20;j++)

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
20 MINOR PROJECT

delay(10);

printf("*");

for(j=0;j<20;j++)

delay(10);

printf("%c",d[j]);

for(j=0;j<20;j++)

delay(10);

printf("*");

gotoxy(10,10);

gotoxy(15,7);

printf("Enter Password:");

while(ch!=13)

ch=getch();

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
21 MINOR PROJECT

if(ch!=13 && ch!=8){

putch('*');

pass[i] = ch;

i++;

pass[i] = '\0';

if(strcmp(pass,password)==0)

gotoxy(15,9);

printf("Password match");

gotoxy(17,10);

printf("Press any key to countinue.....");

getch();

else

gotoxy(15,16);

printf("\aWarning!! Incorrect Password");

getch();

Password();

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
22 MINOR PROJECT

/** Main function started */

int main(){

FILE *fp, *ft; /// file pointers

char another, choice;

int j;

/** structure that represent a employee */

struct emp{

char name[40]; //name of employee

char designation[40]; //designation of the employee

int age; /// age of employee

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
23 MINOR PROJECT

float bs; /// basic salary of employee

int id; // id of the employee

};

struct emp e; /// structure variable creation

char empname[40]; /// string to store name of the employee

long int recsize; /// size of each record of employee

/** open the file in binary read and write mode

* if the file EMP.DAT already exists then it open that file in read write mode

* if the file doesn't exit it simply create a new copy

*/

textcolor(GREEN);

Password();

fp = fopen("z1.dat","rb+");

if(fp == NULL){

fp = fopen("z1.dat","wb+");

if(fp == NULL){

printf("Connot open file");

exit(1);

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
24 MINOR PROJECT

/// sizeo of each record i.e. size of structure variable e

recsize = sizeof(e);

/// infinite loop continues untile the break statement encounter

while(1){

system("cls"); ///clear the console window

textcolor(BLUE);

gotoxy(20,3); /// move the cursor to postion 30, 10 from top-left corner

cprintf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2
MAIN MENU
\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2");

gotoxy(20,5);

cprintf("\xDB\xDB\xDB\xDB\xB2 1. Add Record "); /// option for add


record

gotoxy(20,7);

cprintf("\xDB\xDB\xDB\xDB\xB2 2. List Records"); /// option for showing


existing record

gotoxy(20,9);

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
25 MINOR PROJECT

cprintf("\xDB\xDB\xDB\xDB\xB2 3. Modify Records"); /// option for


editing record

gotoxy(20,11);

cprintf("\xDB\xDB\xDB\xDB\xB2 4. Delete Records"); /// option for


deleting record

gotoxy(20,13);

cprintf("\xDB\xDB\xDB\xDB\xB2 5. Exit"); /// exit from the program

gotoxy(20,15);

cprintf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\x
B2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\x
B2\xB2\xB2\xB2\xB2\xB2\xB2\n");

gotoxy(20,17);

cprintf("Your Choice: "); /// enter the choice 1, 2, 3, 4, 5

fflush(stdin); /// flush the input buffer

choice = getche(); /// get the input from keyboard

switch(choice){

case '1': /// if user press 1

system("cls");

fseek(fp,0,SEEK_END); /// search the file and move cursor to end


of the file

/// here 0 indicates moving 0 distance from the


end of the file

another = 'y';

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
26 MINOR PROJECT

while(another == 'y'){ /// if user want to add another record

cprintf("\nEnter id: ");

scanf("%d",&e.id);

cprintf("\nEnter name: ");

scanf("%s",e.name);

cprintf("\nEnter age: ");

scanf("%d", &e.age);

cprintf("\nEnter Designation: ");

scanf("%s",e.designation);

cprintf("\nEnter basic salary: ");

scanf("%f", &e.bs);

fwrite(&e,recsize,1,fp); /// write the record in the file

cprintf("\nAdd another record(y/n) ");

fflush(stdin);

another = getche();

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
27 MINOR PROJECT

break;

case '2':

//int j;

system("cls");

gotoxy(1,1);

cprintf("*********************************Employee
Details*****************************");

gotoxy(2,2);

cprintf(" ID NAME AGE DESIGNATION SALARY ");

j=4;

//fp=fopen("z.dat","rb+");

rewind(fp); ///this moves file cursor to start of the file

while(fread(&e,recsize,1,fp)==1){ /// read the file and fetch the


record one record per fetch

gotoxy(3,j);

cprintf("%d",e.id);

gotoxy(10,j);

cprintf("%s",e.name);

gotoxy(20,j);

cprintf("%d",e.age);

gotoxy(32,j);

cprintf("%s",e.designation);

gotoxy(52,j);

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
28 MINOR PROJECT

cprintf("%.2f",e.bs);

gotoxy(57,j);

cprintf("\n\n");

j++;

gotoxy(3,25);

// fclose(fp);

getch();

break;

case '3': /// if user press 3 then do editing existing record

system("cls");

another = 'y';

while(another == 'y'){

cprintf("Enter the employee name to modify: ");

scanf("%s", empname);

rewind(fp);

while(fread(&e,recsize,1,fp)==1){ /// fetch all record from file

if(strcmp(e.name,empname) == 0){ ///if entered name


matches with that in file

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
29 MINOR PROJECT

cprintf("\nEnter new id: ");

scanf("%d",&e.id);

cprintf("\nEnter new name: ");

scanf("%s",e.name);

cprintf("\nEnter new age: ");

scanf("%d",&e.age);

cprintf("\nEnter new designation: ");

scanf("%s",e.designation);

cprintf("\nEnter new salary: ");

scanf("%f",&e.bs);

fseek(fp,-recsize,SEEK_CUR); /// move the cursor 1 step


back from current position

fwrite(&e,recsize,1,fp); /// override the record

cprintf("\n **********Updation
sucessfull*************");

break;

if(strcmp(e.name,empname) != 0)

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
30 MINOR PROJECT

cprintf("\n sorry..........entered name is not present in the


file\n");

break;

cprintf("\nModify another record(y/n)");

fflush(stdin);

another = getche();

break;

case '4':

system("cls");

another = 'y';

while(another == 'y'){

cprintf("\nEnter name of student to delete: ");

scanf("%s",empname);

ft = fopen("Temp1.dat","wb"); /// create a intermediate file for


temporary storage

rewind(fp); /// move record to starting of file

while(fread(&e,recsize,1,fp) == 1){ /// read all records from file

if(strcmp(e.name,empname) != 0){ /// if the entered record


match

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER
31 MINOR PROJECT

fwrite(&e,recsize,1,ft); /// move all records except the


one that is to be deleted to temp file

fclose(fp);

fclose(ft);

remove("z1.dat"); /// remove the orginal file

rename("Temp1.dat","z1.dat"); /// rename the temp file to


original file name

fp = fopen("z1.dat", "rb+");

cprintf("Delete another record(y/n)");

fflush(stdin);

another = getche();

break;

case '5':

fclose(fp); /// close the file

exit(0); /// exit from the program

MUKUL GUPTA AND RISHABH REHANI


BCA II-SEMESTER

Вам также может понравиться