8/14/2019 Employee Management in c
1/16
PAGE:1
C PROGRAMMING
Term paper ofC PROGRAMMING..
CSE :202
TERM PAPER TOPIC:-employee MANAGEMENTSYSTEM..!!
SUBMITTED TO: SUBMITTED
BY:
Mr.DEEPAK VISHWAKARMA vinod verma
SEC.-c2802B33
8/14/2019 Employee Management in c
2/16
PAGE:2
C PROGRAMMING
REG.-
10804863
8/14/2019 Employee Management in c
3/16
PAGE:3
C PROGRAMMING
ACKNOWLEDGEMENT
First and foremost I thank my teacher Mr.
DEEPAK VISHWAKARMA has assigned me
this term paper to bring out my creative
capabilities.I express my gratitude to my parents for being a
continuous source of encouragement for all their
financial aid.
I would like to acknowledge the assistance
provided to me by the library staff of LOVELY
PROFESSIONAL UNIVERSITY.
My heartfelt gratitude to my class-mates and for
helping me to complete my work in time.
VINOD VERMA
8/14/2019 Employee Management in c
4/16
PAGE:4
C PROGRAMMINGEmployee Management Database System
#include
#include
#include
#include
#include
#include
#include
#include
class group
{
private:
struct person
{
char flag;
char empcode[5];
char name[40];
int age;
float sal;
int day;
int month;
int year;
}p;
fstream file;
8/14/2019 Employee Management in c
5/16
PAGE:5
C PROGRAMMINGpublic:
group();
void addrec();
void listrec();
void modirec();
void delrec();
void recallrec();
void packrec();
void exit();
};
void main()
{
char choice,v;
group g;
do
{
clrscr();
struct dosdate_t d;
_dos_getdate(&d);
// p.day=d.day;
// p.month=d.month;
// p.year=d.year;
8/14/2019 Employee Management in c
6/16
PAGE:6
C PROGRAMMING// _dos_getdate(&d);
gotoxy(12,5);
textcolor(6);
cprintf("Todays date:");
printf("%d",d.day);
cout
8/14/2019 Employee Management in c
7/16
PAGE:7
C PROGRAMMINGcout
8/14/2019 Employee Management in c
8/16
PAGE:8
C PROGRAMMINGg.packrec();
break;
case'0':
g.exit();
exit(1);
}
}
while(choice!=0);
}
void group::group()
{
file.open("Emp.dat",ios::binary|ios::in|ios::out);
p.flag=' ';
if(!file)
{
cout
8/14/2019 Employee Management in c
9/16
PAGE:9
C PROGRAMMINGchar ch;
file.seekp(0L,ios::end);
struct dosdate_t d;
_dos_getdate(&d);
p.day=d.day;
p.month=d.month;
p.year=d.year;
cout
8/14/2019 Employee Management in c
10/16
PAGE:10
C PROGRAMMINGwhile(ch=='y'||ch=='Y');
}
void group::listrec()
{
int j=0,a;
file.seekg(0L,ios::beg);
cout
8/14/2019 Employee Management in c
11/16
PAGE:11
C PROGRAMMINGcout
8/14/2019 Employee Management in c
12/16
PAGE:12
C PROGRAMMINGp.day=d.day;
p.month=d.month;
p.year=d.year;
p.flag=' ';
pos=count*sizeof(p);
file.seekp(pos,ios::beg);
file.write((char*)&p,sizeof(p));
return;
}
count++;
}
cout
8/14/2019 Employee Management in c
13/16
PAGE:13
C PROGRAMMING{
p.flag='*';
pos=count*sizeof(p);
file.seekp(pos,ios::beg);
file.write((char*)&p,sizeof(p));
return;
}
count++;
}
cout
8/14/2019 Employee Management in c
14/16
PAGE:14
C PROGRAMMING{
if(strcmp(p.empcode,code)==0)
{
p.flag=' ';
pos=count*sizeof(p);
file.seekp(pos,ios::beg);
file.write((char*)&p,sizeof(p));
return;
}
count++;
}
cout
8/14/2019 Employee Management in c
15/16
PAGE:15
C PROGRAMMING}
outfile.close();
file.close();
remove("Emp.DAT");
rename("TEMP","EMP.DAT");
file.open("EMP.DAT",ios::binary|ios::in|ios::out|ios::nocreate);
gotoxy(10,10);
cout
8/14/2019 Employee Management in c
16/16
PAGE:16
C PROGRAMMING
www.planet-source-code.com/
www.codeproject.com/