Coding Section

/* class containing functions, variables regarding update in emp info */
class upddate
void edata();
void empl();
void wdata();
void udate();
void anewemp();
void uname();
void ufname();
void ulname();
void utel();
void udesi();
void uotel();
void urtel();
void uadd();
void uoadd();
void uradd();
char f1name[],f2name[],l1name[],l2name[],desii[],off1add[],res1add[];

float off1tel,off2tel,res1tel;
char fme[15],lme[15],ds[20],ofad[50],l3name[],read[50];
long v,lo;
int na,dd,mm,yy,rec;
/* class containing functions,variables regarding employee info,date */
class emp :public upddate
void l();
void l1();
void l2();
void l3();
void sfname();
void slname();
void sdesi();
void exitt();
void showmain();
void exiit();
char f1name[],l3name[],off3add[],res3add[],desii[];
float off3tel,res3tel;
/* class containing all the data related to file handling*/
class fl :public upddate
void list2();
void list();
void list1();

void addetail(char[], char [],char[],
/*function to show the main screen of the project */
void emp::showmain(void)
int j;
char choice;
{ gotoxy(6,j);
{ gotoxy(j,44);
{ gotoxy(70,j);
{ gotoxy(j,8);
RECORDS--- \n";
cout<<"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n";









cout<<" please enter your choice:-


upddate a;

else if(choice=='3')
emp e;

/*function to exit from the application*/
void emp::exiit()
cout<<"** HAVE A NICE TIME GOOD DAY **\n";

/*function to come to main menu*/ void emp::exitt() { clrscr().j++) { gotoxy(j.} gotoxy(19. emp a.8).j<70.} for(j=6.48). while(1) { for(j=8.j<49.} for(j=7.\\ . cout<<" -. char ch.} for(j=8.j++) { gotoxy(j.showmain(). cout<<"*\n".j). cout<<"*\n".j++) { gotoxy(6.j++) { gotoxy(70.j).j<49. } /*function to show the employee info screen*/ void upddate::empl() { int j. cout<<"*\n". cout<<"*\n". upddate k.j<70. clrscr().\n".WELCOME TO EMPLOYEE INFORMATION -. a.15).

cout<<" 1.37). if(ch=='1') { clrscr().exit from application \n".22). gotoxy(17. cout<<" 3.19). cout<<" 4. cout<<" 6. k.25).40). z. gotoxy(17.search employee by first name \n". emp z.search employee by last name \n". cout<<" please enter your choice:gotoxy(44.40). gotoxy(17. k. cout<<" 2. z.31). gotoxy(17. ch=getche(). .search by employee designation \n". } else if(ch=='2') { clrscr().exit to main menu \n". } Else ". gotoxy(15.gotoxy(16.sfname().28).empl(). cout<<" 5. cout<<"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n".slname().list of all the employee \n".34).empl(). gotoxy(17. gotoxy(17.

p.list().seekg(0.exiit().} else if(ch=='5') { z. r.empl(). cin>>l3name. cout<<"! enter name: ". int count=0.exitt().open("C:\TC\TC\Bin\pp.ios::in). gotoxy(22. }}} /*function to search employee by last name*/ void emp::slname() { emp r.dat".} else if(ch=='6') { z.sdesi().l().22). k. k. } else if(ch=='4') { fl a. fstream p. z. .if(ch=='3') { clrscr().ios::beg). a. p.empl().

.21).24).18). cout<<"residence address:-". gotoxy(10.lme. cout<<read.. gotoxy(30. cout<<"! name present". cout<<" THE DETAILS OF THE EMPLOYEE". cout<<ds. .25). cout<<fme.read((char*)this. gotoxy(30. cout<<"last name:-". gotoxy(10. gotoxy(10.8).sizeof(fl))) {int h=strncmp(l3name. cout<<"first name:-".while(p. gotoxy(30.15).24). cout<<ofad.10). gotoxy(30. if(h==0) { gotoxy(22. cout<<"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^".27). gotoxy(15. gotoxy(10.l3().15). cout<<lme.27). cout<<"designation:-". gotoxy(30.18). gotoxy(19. count=1.21).15). gotoxy(10. r. cout<<"office address:-".

. cout<<". clrscr().33).36). getch(). gotoxy(36. .33).close().39). cout<<mm. gotoxy(10. cout<<dd. gotoxy(33.36). cout<<"date of joining:-". cout<<". cout<<"std code of resi:-". cout<<yy.39).30). gotoxy(30.30).39). cout<<na.". gotoxy(10.39).39). cout<<"residence telephone:-". gotoxy(30. gotoxy(35. gotoxy(32. cout<<v.gotoxy(10..39). cout<<lo. }} p.33). gotoxy(10. gotoxy(31.. gotoxy(30. continue. gotoxy(32.". cout<<"office telephone:-". cout<<"0".

r.24). gotoxy(22. cin>>f1name. if(k==1){ clrscr().26). gotoxy(22. cout<<"! enter name :". cout<<"! Name entered : "<<l3name. .22). gotoxy(22. cout<<"! Press 2 to exit".22). cout<<"! Press 1 to enter again". goto g.l().30). cout<<"wrong option selected reselect". cout<<"! Data not present". gotoxy(22. } else if(k==2){ else{ gotoxy(22. cout<<"Select your choice ".28). int k. cin>>k. }}} /*functions to searh employee by first name*/ void emp::sfname() { emp r. gotoxy(22.g: if(count==0) { clrscr().20). slname().l(). delay(2000). r. gotoxy(22. fstream p.

gotoxy(30.18). cout<<"! name present"..read((char*)this. gotoxy(15.15).21).open("C:\TC\TC\Bin\pp.ios::beg). cout<<"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^". int count=0. gotoxy(10.fme. p. gotoxy(10.15). gotoxy(10. cout<<"first name:-".sizeof(fl))) { int h=strncmp(f1name. cout<<"last name:-". gotoxy(30.15).25).dat".p. r.8). gotoxy(30.18). ..ios::in). cout<<fme. gotoxy(30. cout<<" THE DETAILS OF THE EMPLOYEE". cout<<ds. cout<<"designation:-". cout<<"office address:-".10).24). cout<<lme. while(p. count=1.21). gotoxy(10. cout<<ofad. gotoxy(19.24).l3().seekg(0. if(h==0) { gotoxy(22.

gotoxy(10.. gotoxy(30. gotoxy(35. gotoxy(30. . cout<<v. cout<<na.39).gotoxy(10.39).39). cout<<"residence telephone:-".36)..27).39).33). gotoxy(10. gotoxy(10.27)..33). gotoxy(30. gotoxy(31. cout<<read.39). gotoxy(30. cout<<"residence address:-".39). cout<<"0". cout<<". cout<<"date of joining:-".". gotoxy(10. gotoxy(32. cout<<lo.".36). getch(). gotoxy(33.30). gotoxy(32. cout<<mm. gotoxy(36.30). cout<<"office telephone:-". cout<<".33). cout<<yy. cout<<dd. cout<<"std code of resi:-".

g: if(count==0) { clrscr().28). r.close(). int k. }} /*functions to search employee by designation*/ .26). } else if(k==2){ } else{ gotoxy(22. sfname().24). gotoxy(22.22). cout<<"Select your choice ".l(). cout<<"! Name entered : "<<f1name. gotoxy(22. cout<<"! Press 2 to exit".30). gotoxy(22. if(k==1){ clrscr(). goto g. } } p. cout<<"! Data not present". delay(2000).clrscr(). cout<<"wrong option selected reselect". cin>>k.20). gotoxy(22. cout<<"! Press 1 to enter again". gotoxy(22. continue.

gotoxy(15. int count=0. r. fstream p.l().void emp::sdesi() { clrscr(). cout<<fme.read((char*)this. p. cin>>desii.seekg(0.dat".25). while(p. count=1. gotoxy(30. cout<<"! enter designation: ". cout<<"last name:-".sizeof(fl))) { int h=strncmp(desii. gotoxy(10. if(h==0) { gotoxy(22.15). cout<<"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^".15). .open("C:\TC\TC\Bin\pp.22).8). gotoxy(10. r.10).ios::beg). gotoxy(19. cout<<"first name:-".18).15).ios::in). gotoxy(22. emp r. cout<<" THE DETAILS OF THE EMPLOYEE".l3(). p.ds. cout<<"! designation present".

gotoxy(31. . cout<<"0". gotoxy(10.33).30). gotoxy(10.. cout<<"residence address:-".33). gotoxy(10.39).21).39). gotoxy(30. cout<<"designation:-". gotoxy(32. cout<<lme. cout<<ds. cout<<"office telephone:-". gotoxy(30. cout<<ofad. cout<<lo.27). gotoxy(30.33).. cout<<read.24).36). gotoxy(30. cout<<v. gotoxy(10. gotoxy(30.18).27).. gotoxy(10. gotoxy(30. gotoxy(10.36). gotoxy(10.21). cout<<"office address:-".30).24). cout<<"std code of resi:-".gotoxy(30. cout<<"date of joining:-". cout<<"residence telephone:-". cout<<na.

22).20). gotoxy(22. gotoxy(32. }} p. cout<<". r. gotoxy(22. } .. if(k==1){ sdesi().. cout<<yy. getch(). gotoxy(22. cout<<".39). cout<<mm. continue. cout<<"! Press 1 to enter again".39). cout<<"! Designation entered :"<<desii.cout<<dd. cin>>k. int k.26).28). g: if(count==0) { clrscr(). cout<<"Select your choice ". gotoxy(35. cout<<"! Press 2 to exit". gotoxy(22. clrscr().".39). cout<<"! Data not present".l().39). gotoxy(33.close().". gotoxy(36. gotoxy(22.24).

j<45.j<70. .j<70.else if(k==2){ } else{ gotoxy(22. gotoxy(17.j<45.} gotoxy(20.j). for(j=8. cout<<"*\n".j++) { gotoxy(j.8). }} } /*function to show list of working employees*/ void fl::list() { char ch5.12).30). while(1) { clrscr(). cout<<"*\n". cout<<"wrong option selected reselect".} for(j=8. goto g.j++) { gotoxy(70.44).j).16).j++) { gotoxy(j. cout<<"-. int j. cout<<" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n".WELCOME TO EMPLOYEE INFORMATION --\n". cout<<"*\n".} for(j=7. cout<<"*\n".} for(j=6. delay(2000).j++) { gotoxy(6.

exit from application \n".list().go to main menu \n".35).35). cout<<" 5.22). cout<<" 2. cout<<" 4. } else ".25). cout<<" 3. r.19).31).go to previous screen \n". gotoxy(17.28).office information \n".empl().gotoxy(17. } else if(ch5=='2') { fl p. p.residence information \n". r. gotoxy(17. ch5=getche().list(). if(ch5=='1') { fl r. cout<<" please enter your choice:gotoxy(42. cout<<" 1.list2(). . p. r. gotoxy(17.list1(). } if(ch5=='3') { upddate r. gotoxy(15. gotoxy(17.

} for(j=8.j).j<45.j++) { gotoxy(70.j++) { gotoxy(j.12).exiit(). cout<<"*\n". while(1) { clrscr().} for(j=6.} getch().8). cout<<"*\n".j).} gotoxy(23.j<70. }} /*function to show update screen*/ void upddate::udate() { char ch1. for(j=8.j++) { gotoxy(6.} else if(ch5=='5') { emp d.j++) { gotoxy(j.} for(j=7.exitt().44). . c.j<45. cout<<"*\n".if(ch5=='4') { emp c. int j. cout<<"*\n".j<70. d.

gotoxy(17.31). } else if(ch1=='2') { upddate p. \n". p.25). ch1=getche().40). gotoxy(15. gotoxy(17.update designation \n".16). gotoxy(17. cout<<" 2.22).uname(). gotoxy(17. gotoxy(17.exit to main menu \n". cout<<" 1.update telephone no. . cout<<" 6.37). if(ch1=='1') { upddate r. cout<<" 3.update name \n".WELCOME TO UPDATE RECORD --\n". r.exit from application \n". } ".34).cout<<"-. cout<<" 4.28).update address \n".19). gotoxy(17. cout<<" 5. gotoxy(17. gotoxy(17. cout<<" 7.add new employee \n". cout<<" please enter your choice:gotoxy(44.40). cout<<" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n".anewemp().

exitt().mmonth.resadd[50].offadd[50].else if(ch1=='3') { upddate v.uadd().} else if(ch1=='6') { emp c. } else if(ch1=='4') { upddate v.} else if(ch1=='7') { emp d. v.desi[20]. d.exiit().lname[15].utel().udesi(). c. }}} /*function to add new employee details*/ void upddate::anewemp() { int dday. v. char fname[15].yyear. s. } else if(ch1=='5') { upddate s. .

cout<<"*\n".} gotoxy(19. gotoxy(10.} for(j=7. gotoxy(10.18). cout<<"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^".long ot.rt.j<45.10).j).j++) { gotoxy(j.6).18).15). gotoxy(48. gets(fname). clrscr(). getch(). cout<<"ENTER THE DETAILS OF THE EMPLOYEE". . fl q. cout<<"enter first name of the employee:-".rec.44).j++) { gotoxy(j.j<45.8).} for(j=6. for(j=6. gotoxy(15. cout<<"*\n".j<75. getch().j++) { gotoxy(6. int co. cout<<"enter the last name of the employee:-".} for(j=6.j). gets(lname).j++) { gotoxy(75.j<75. gotoxy(45.15). int j. cout<<"*\n". cout<<"*\n".

21). gets(offadd). cout<<"enter the residence telephone:-". getch(). cin>>ot.30).30).27). cin>>co.33).33). gotoxy(10. gotoxy(40. gotoxy(10.24). gotoxy(10. gotoxy(10. gotoxy(39. cout<<"0". getch(). gotoxy(40.24). gotoxy(10. gotoxy(37.36). getch(). gets(resadd). cout<<"enter the std code of resi:-". cout<<"enter the residence address:-".21).gotoxy(10. gets(desi).27).33). cin>>rt. cout<<"enter the office telephone:-". gotoxy(39. . gotoxy(42. cout<<"enter the office address:-".36). getch(). gotoxy(50. cout<<"enter the designation of the employee:-". getch().

".39).lname. } else { gotoxy(50. cin>>dday. gotoxy(43.co.udate(). cout<<".ot. o: char k. upddate i. getch().43). cin>>k. getch().offadd. cout<<"Save record y/n".".39). i.resadd.39).dday. gotoxy(10.39). getch(). i. gotoxy(66. if(k=='y'|k=='Y') {q.rt. cin>>mmonth.41). gotoxy(39. cout<<"date of joining(dy.39).} else if(k=='n'|k=='N') { upddate i.desi.addetail(fname. gotoxy(37.mn.41). gotoxy(40. cin>>yyear. gotoxy(50.39).getch().yr):-". .udate(). cout<<". gotoxy(42.mmonth.yyear).

j++) { gotoxy(j.j<70. char ch2. for(j=8.} for(j=7.15).} for(j=6. goto o. cout<<"*\n".\n".cout<<"Press either yes/no".j++) { gotoxy(j.j).10). cout<<"*\n".} for(j=8.8). cout<<"*\n".j). gotoxy(20.update first name \n". cout<<"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^".update last name \n". int j.} gotoxy(25.j<45.19).13). . while(1) { clrscr().j<70.44). cout<<" 2.j++) { gotoxy(70. }} /*function to show update name */ void upddate::uname() { char desi[20]. cout<<"*\n". cout<<" 1.j<45. gotoxy(20.j++) { gotoxy(6. gotoxy(20. cout<<" --UPDATE NAME-.

r.31). upddate r.go to previous screen \n".ulname(). cout<<" please enter your choice:. upddate p.udate(). gotoxy(20.udate().35). } else if(ch2=='2') { clrscr().gotoxy(20. c.\n". ch2=getche(). gotoxy(20.27). cout<<" 5.ufname(). p. if(ch2=='1') { clrscr().udate(). cout<<" 4.exit from application \n".23). p. gotoxy(50. } else if(ch2=='3') { upddate c.go to main menu \n".} else if(ch2=='4') . r.35). cout<<" 3. gotoxy(20.

} } void emp::l1() { int j.32).j<69.} for(j=8. cout<<"*\n".18). d.j<33.j<55. for(j=16.j++) . cout<<"*\n". c.} for(j=20.j).} for(j=18.j++) { gotoxy(8.j++) { gotoxy(j.j<33.exitt().} else if(ch2=='5') { emp d.j++) { gotoxy(j.j++) { gotoxy(55. for(j=18.j).j++) { gotoxy(20. cout<<"*\n". }}} /*function for loop*/ void emp::l() { int j. cout<<"*\n". cout<<"*\n".{ emp c.} for(j=20.j<33.j).j<55.exiit().

32).} for(j=20.{ gotoxy(j.} for(j=18. .18).j).28).j). cout<<"*\n". cout<<"*\n". for(j=18. cout<<"*\n".} for(j=20.j<55.j<69.j++) { gotoxy(j. cout<<"! wait for few seconds ".} } void emp::l2() { int j. cout<<"*\n". clrscr(). cout<<"*\n".j<33.j++) { gotoxy(20.j++) { gotoxy(j.j). delay(3000).} } void emp::l3() { gotoxy(22.j++) { gotoxy(69.16). cout<<"*\n".} for(j=8.j++) { gotoxy(j.} for(j=16.j++) { gotoxy(55.j<33.j<55. cout<<"*\n".j<33.32).

int j.l[25].j++) { gotoxy(6.j).l().j<45. } else{ e. return. emp e. getch(). if(pfile== NULL) { cout<<"no such file exist".j).j<75.l1[25].6). FILE *pfile.} for(j=7. .j++) { gotoxy(j. cout<<"*\n". fl y. cout<<"*\n"."r"). cout<<"*\n". cout<<"*\n".} for(j=6.j<75.j++) { gotoxy(j. for(j=6.} for(j=6.j++) { gotoxy(75.dat". pfile=fopen("C:\TC\TC\Bin\pp.} } /*function to show updated last name*/ void upddate::ulname() { int count=0.44). clrscr().j<45. char u[25].

25). strcpy(lme. gotoxy(22.dat". gotoxy(22.15). } g. g. p. g. remove("C:\TC\TC\Bin\pp. fstream g.close().dat".20). gets(l).ios::in).open("temp. . cout<<"! name present".dat".} g: if(count==0) { clrscr().fme. while(p. cout<<"! enter lname ".read((char*)this. gotoxy(22.lme. fstream p. } p.28). cout<<"! updated name ".. int h=strncmp(l.sizeof(fl)).u).close()."C:\TC\TC\Bin\pp.open("C:\TC\TC\Bin\pp. gets(u).gotoxy(22. cout<<"! enter fname ".dat").sizeof(fl))) { int k=strncmp(l1.22).ios::out|ios::ate).write((char*)this.15). gets(l1). if(h==0&k==0) { count=1.dat"). rename("temp.

24).20). gotoxy(22.30).e. . int j. emp e. } else if(k==2){ else{ gotoxy(22. cout<<"wrong option selected reselect". cin>>k. cout<<"Select your choice ". gotoxy(22. gotoxy(22.l(). cout<<"! Data not present". }} } /*function to show updated first name*/ void upddate::ufname() { int count=0. gotoxy(22. cout<<"! Press 2 to exit".28). cout<<"! Press 1 to enter again". clrscr(). if(k==1){ ulname(). int k. delay(2000).26). cout<<"! Name entered :"<<l. goto g.22). gotoxy(22.

if(h==0&q==0) { count =1. gets(l). fstream p. gotoxy(22.ios::out|ios::ate). cout<<"! name present". getch().ios::in).l().15). cout<<"! updated name ".open("temp.sizeof(fl))) { int h=strncmp(l1. char u[25]. FILE *pfile.u). pfile=fopen("C:\TC\TC\Bin\pp. g. } else{ e.20).l[25].lme. gets(l1).open("C:\TC\TC\Bin\pp.fme.\ fl y. cout<<"! enter fname ".read((char*)this. fstream g. gotoxy(22.25)."r").22).28). gets(u).dat". return.15).dat". cout<<"! enter lname ". int q=strncmp(l.l1[25]. } . while(p. if(pfile== NULL) { cout<<"no such file exist". p. strcpy(fme. gotoxy(22.dat". gotoxy(22.

g.dat". cout<<"! Press 2 to exit". delay(2000).26). gotoxy(22.close(). } else if(k==2){ } else{ gotoxy(22. cout<<"! Press 1 to enter again".24).20).write((char*)this.close().30). cout<<"Select your choice ". } g: if(count==0) { clrscr(). cout<<"wrong option selected reselect". gotoxy(22. goto g. gotoxy(22. remove("C:\TC\TC\Bin\pp. cin>>k. rename("temp.22).sizeof(fl)).28). e. gotoxy(22.l().dat"). cout<<"! Name entered :"<<l.dat"). cout<<"! Data not present". } p. gotoxy(22. g. if(k==1){ ufname(). } ."C:\TC\TC\Bin\pp. int k.

20). return. pfile=fopen("C:\TC\TC\Bin\pp. p.ios::in).ios::out|ios::ate).dat". int q=strncmp(l. int count=0. gets(l).15). cout<<"! enter fname ".ds. if(h==0&q==0) { count=1.22).}} /*function to update designation*/ void upddate ::udesi() { emp e.open("temp. fstream p. if(pfile== NULL) { cout<<"no such file exist".open("C:\TC\TC\Bin\pp. } else { e.15). cout<<"! enter designation ". while(p.l1[25]. fl y. g. gotoxy(22.l[25]. fstream g. gotoxy(22. gets(l1)."r"). FILE *pfile.dat".sizeof(fl))) { int h=strncmp(l. char u[25].dat". getch().l(). .read((char*)this.ds. clrscr().

u).dat".20)."C:\TC\TC\Bin\pp. } g. } g: if(count==0) { clrscr().28). cout<<"! Designation entered :"<<l. strcpy(ds. cin>>k. cout<<"! updated designation ".22).28). if(k==1){ udesi().write((char*)this.l().gotoxy(22. cout<<"! designation present". e. rename("temp. gotoxy(22. int k. } .close(). cout<<"! Data not present".sizeof(fl)). gotoxy(22. gotoxy(22.dat").26). cout<<"! Press 1 to enter again".25). gets(u). cout<<"Select your choice ".24). } p. gotoxy(22. g. remove("C:\TC\TC\Bin\pp.dat").close(). gotoxy(22. cout<<"! Press 2 to exit". gotoxy(22.

delay(2000). }}} /*function to update address */ void upddate::uadd() { int j. char ch3. goto g.j++) { gotoxy(j. for(j=8. cout<<" --UPDATE ADDRESS-.} for(j=8.desi[20].j<45.j<45.8). cout<<"*\n". gotoxy(20.j). cout<<"*\n".j++) { gotoxy(j.} for(j=7.13). cout<<"wrong option selected reselect".j).j<70.} gotoxy(25.j++) { gotoxy(6.} for(j=6.\n".j++) { gotoxy(70. . cout<<"*\n".j<70.30). cout<<"*\n".10).44). while(1) { clrscr().else if(k==2){ } else{ gotoxy(22.

19). cout<<" 2. cout<<" 4. p.23). gotoxy(50. gotoxy(20. gotoxy(20. upddate r. ch3=getche(). cout<<" please enter your choice:.udate().go to previous screen \n". if(ch3=='1') { clrscr().uoadd(). getch().27).update residence address \n". } else if(ch3=='2') { clrscr().udate(). } . gotoxy(20. cout<<" 3. gotoxy(20. cout<<" 1.go to main menu \n". r. upddate p. p. cout<<" 5.cout<<"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^".\n".35).15). getch(). r. gotoxy(20.35).31).uradd(). gotoxy(20.exit from application \n".update office addresss \n".

else if(ch3=='3') { upddate c.} else if(ch3=='4') { emp c. }}} /*function to show updated off address*/ void upddate::uoadd() { int count=0. char u[25].exiit().exitt(). d. if(pfile== NULL) { cout<<"no such file exist". FILE *pfile."r"). . fl y.} else if(ch3=='5') { emp d. getch(). clrscr().l[25].udate(). c.dat". emp e. c. pfile=fopen("C:\TC\TC\Bin\pp.

dat").close().ios::out|ios::ate). } g: if(count==0) { clrscr().dat".ios::in).close(). } g. rename("temp. cout<<"! address is present".20).15).sizeof(fl))) { int h=strncmp(l. cout<<"! enter address ". .l1(). } p.26).sizeof(fl)). if(h==0) { count=1.open("C:\TC\TC\Bin\pp. gets(l).23).open("temp.read((char*)this.return. gets(u). g..ofad. gotoxy(10.write((char*)this."C:\TC\TC\Bin\pp.dat".u). gotoxy(10. while(p. cout<<"! updated address ". remove("C:\TC\TC\Bin\pp. fstream g. g. p.dat".dat"). gotoxy(10. strcpy(ofad. } else{ e. fstream p.

cout<<"! press 1 to enter again". if(k==1){ uoadd().20). cout<<"! Data not present". . cout<<"wrong option selected reselect". gotoxy(10. goto g. gotoxy(10.28). cin>>k.28). gotoxy(10.l1().e. } else if(k==2){ } else{ gotoxy(10.26). gotoxy(29. delay(2000). gotoxy(10. }}} /*function to show updated res address*/ void upddate::uradd() { emp e.22). clrscr().24). int k. cout<<"! press 2 to exit".30). gotoxy(10. cout<<"Select your choice". cout<<"! address entered :"<<l.

gets(u). pfile=fopen("C:\TC\TC\Bin\pp.ios::in). cout<<"! address is present".fl y.open("C:\TC\TC\Bin\pp. fstream p. getch().26). strcpy(read. } g.write((char*)this. if(pfile== NULL) { cout<<"no such file exist".20)."r").l1(). return. while(p.dat".15). } else{ e.u).open("temp. gotoxy(10. char u[25]. fstream g. FILE *pfile. cout<<"! enter address ". if(h==0) { count=1.dat".. int count=0.} .dat". g. gets(l). cout<<"! updated address ".read((char*)this.read.23).l[25].sizeof(fl))) { int h=strncmp(l.ios::out|ios::ate). p.sizeof(fl)). gotoxy(10. gotoxy(10.

} g: if(count==0) { clrscr().dat"). gotoxy(10.24). goto g. gotoxy(29. cout<<"wrong option selected reselect". cout<<"! address entered :"<<l.close(). if(k==1){ uradd().close()."C:\TC\TC\Bin\pp. e.dat".28). }}} /*function to update telephone no. gotoxy(10. cout<<"Select your choice".26).dat"). delay(2000). } else if(k==2){ } else{ gotoxy(10. cout<<"! press 1 to enter again". int k. cout<<"! press 2 to exit". rename("temp.*/ . gotoxy(10. cin>>k. cout<<"! Data not present".20).p.22).28). g.30).l1(). remove("C:\TC\TC\Bin\pp. gotoxy(10. gotoxy(10.

void upddate::utel() { int j.8). gotoxy(20. gotoxy(20. cout<<" 2.update office telephone \n".} for(j=7. cout<<" 4.27).} for(j=8.19).j++) { gotoxy(6.31).j<70. cout<<"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^".j++) { gotoxy(j. cout<<" 1. gotoxy(20. char ch4.13). cout<<" --UPDATE TELEPHONE-. gotoxy(20.44).} gotoxy(25.j<45.10). while(1) { clrscr(). cout<<"*\n".23). gotoxy(20.j<70.j<45. cout<<"*\n".15).\n".go to previous screen \n".} for(j=6. for(j=8.j++) { gotoxy(70. cout<<"*\n".go to main menu \n".j).j). cout<<" 3.update residence telephone \n". .j++) { gotoxy(j. cout<<"*\n". gotoxy(20.

udate().cout<<" 5. r. getch().\n".35). } else if(ch4=='3') { upddate c. cout<<" please enter your choice:. } else if(ch4=='2') { clrscr(). ch4=getche(). upddate p. upddate r. gotoxy(50.35). p.uotel().urtel().exit from application \n".} else if(ch4=='5') { emp d.udate().exitt(). getch().} else if(ch4=='4') { emp c. gotoxy(20. p.udate(). c. c. . r. if(ch4=='1') { clrscr().

dat". if(pfile== NULL) { cout<<"no such file exist". getch().open("C:\TC\TC\Bin\pp.l2().read((char*)this. int count=0."r"). }}} /*function to update res tel*/ void upddate::urtel() { emp e. p.ios::out|ios::ate). pfile=fopen("C:\TC\TC\Bin\pp. FILE *pfile. fstream g. return. while(p.l.exiit(). gotoxy(22. long u.dat".ios::in). ".sizeof(fl))) { if(l==lo) .dat".d. cout<<"! enter no. fstream p. } else{ e.open("temp. g. cin>>l. clrscr(). fl y.22).

gotoxy(41.close().write((char*)this. gotoxy(22. } p. } g. lo=u. cin>>u.28).25). remove("C:\TC\TC\Bin\pp. cout<<"! Data not present". e. gotoxy(22.22). cout<<"! press 2 to exit". rename("temp.dat"). gotoxy(22.24). cout<<"Select your choice". gotoxy(22.{ count =1. g.sizeof(fl)). cout<<"! press 1 to enter again". gotoxy(22. int k. cout<<"! updated no ". gotoxy(22.28)."C:\TC\TC\Bin\pp. gotoxy(22.26).close(). . cout<<"! no entered by you "<<l.dat").dat".l2(). } g: if(count==0) { clrscr().20). cout<<"! no present".28).

int count=0. if(pfile== NULL) { cout<<"no such file exist"."r"). }}} /*function to update office tel*/ void upddate::uotel() { emp e.dat".22). clrscr(). FILE *pfile.30). cout<<"! enter no. cout<<"wrong option selected reselect". long u. delay(2000). } else{ e. fl y. if(k==1){ urtel().cin>>k. ". cin>>l. .l2(). return. pfile=fopen("C:\TC\TC\Bin\pp.l. goto g. gotoxy(22. getch(). } else if(k==2){ } else{ gotoxy(22.

sizeof(fl)).20).dat").close().sizeof(fl))) { if(l==v) { count=1. . cout<<"! no entered by you "<<l. while(p. v=u. gotoxy(22.ios::in).write((char*)this. cout<<"! updated no ".close().open("temp.read((char*)this. e. p. } g: if(count==0) { clrscr().dat". rename("temp.25). g. fstream g.dat"). remove("C:\TC\TC\Bin\pp. gotoxy(22. cout<<"! no present".open("C:\TC\TC\Bin\pp.22). cout<<"! Data not present".l2().28). } g."C:\TC\TC\Bin\pp.ios::out|ios::ate). } p.dat". gotoxy(22.dat". cin>>u. gotoxy(22.fstream p. g.

j<47. } else if(k==2){ } else{ gotoxy(22. cin>>k. cout<<"Select your choice".j++) { gotoxy(5. fl k.28). if(k==1){ uotel().24).26). cout<<"|\n". cout<<"! press 1 to enter again". gotoxy(41. cout<<"wrong option selected reselect".j++) { gotoxy(21. for(j=3. cout<<"! press 2 to exit". gotoxy(22.30).} for(j=3. gotoxy(22. cout<<"|\n".int k.28). delay(2000). goto g.j).} .j<47. }}} /*function to manage list */ void upddate::wdata() { clrscr(). gotoxy(22. int j.j).

j++) { gotoxy(79.} for(j=3. cout<<"______________________________________________________________________ _________".6).j<79.j++) { gotoxy(30.5).46).} for(j=2. .j). cout<<"_". cout<<"|\n". cout<<"|\n".j<47.j++) { gotoxy(1.j++) { gotoxy(j.2).j).} for(j=2.j++) { gotoxy(j. cout<<"-".for(j=3.} for(j=3.} gotoxy(22.j<47.j). gotoxy(2. cout<<" THE DETAILS OF THE EMPLOYEE".5). cout<<"|\n".j).j<79.j++) { gotoxy(65. cout<<"|\n".} for(j=3. gotoxy(1.j<47. cout<<"SNO". gotoxy(10.j<47.3).

cout<<"|\n".j<47.j++) { gotoxy(5.j). gotoxy(23.j). int j. fl k. gotoxy(40.j++) { gotoxy(65.j++) { gotoxy(1.ADDRESS".j<47.} for(j=3. for(j=3.j<47.j<47. cout<<"DESI. cout<<"RS. ". } /*function to manage list */ void upddate::edata() { clrscr(). cout<<"|\n".5).TEL".j).j++) { gotoxy(21.j++) { gotoxy(30.j<47. cout<<"|\n".j<47. cout<<"|\n".5).} for(j=3. gotoxy(69. cout<<"|\n".5).j++) .j).} for(j=3.} for(j=3.cout<<"NAME ". cout<<"RES.} for(j=3.j).

TEL".ADDRESS". cout<<"DESI. gotoxy(1.j<79. gotoxy(2.5). ". char lname[]. cout<<"______________________________________________________________________ _________".j++) { gotoxy(j. cout<<"-".5). gotoxy(40. } /*function to manage new emp detail into file*/ void fl::addetail(char fname[].2).} for(j=2. cout<<"|\n". cout<<"OFF. gotoxy(10.5).3).j).{ gotoxy(79. gotoxy(23.j++) { gotoxy(j.46). cout<<"SNO".5).} for(j=2. cout<<"NAME ".5). cout<<"_".6).char desi[].} gotoxy(22. . cout<<"OFF. cout<<" THE DETAILS OF THE EMPLOYEE".j<79. gotoxy(69.

offadd).int dday.long ot. FILE *pfile.open("C:\TC\TC\Bin\pp. fstream g. mm=mmonth. na=co. pfile=fopen("C:\TC\TC\Bin\pp. . v=ot.int yyear) { fl s[10].int mmonth.write((char*)this. int co. dd=dday.long rt. re.fname).ios::out|ios::app). } /*function to show the list of employee*/ void fl::list1() { upddate e. strcpy(read. fl y.resadd).dat". lo=rt. strcpy(fme.sizeof(fl)).desi). re. re. strcpy(ofad. strcpy(ds. clrscr()."r").char resadd[]. yy=yyear.char offadd[]. fstream re. strcpy(lme.close().lname).dat".

getch(). g.open("C:\TC\TC\Bin\pp.ios::in).ios::beg). cout<<fme. int sno=1.i<s.i+2). int i=8. } else{ clrscr(). for(i.if(pfile== NULL) { cout<<"no such file exist". cout<<"0"<<na<<"-"<<lo. cout<<sno. while(g. cout<<read. g. gotoxy(32.i).read((char*)this. i=i+3.seekg(0.sizeof(fl))) { s=i+1. gotoxy(66. if(i==44) .i).i).dat". return.i). gotoxy(22.wdata().i++) {gotoxy(3. cout<<lme. e. int s.} sno++. cout<<ds. gotoxy(6.i). gotoxy(6.

getch().ios::in).edata(). e. getch(). int sno=1. } else{ clrscr(). if(pfile== NULL) { cout<<"no such file exist". . g.close().} /*function to show the list of employee*/ void fl::list2() { upddate e.dat".{ i=8. cout<<"press enter to continue application".48).open("C:\TC\TC\Bin\pp.seekg(0. clrscr(). FILE *pfile. getch(). clrscr(). int s. fl y.wdata(). } }} g. return. g. gotoxy(10."r").ios::beg). e. fstream g. pfile=fopen("C:\TC\TC\Bin\pp.dat".

sizeof(fl))) { s=i+1. cout<<ds.edata(). i=i+3.i<s. cout<<"press enter to continue application".i). gotoxy(6. clrscr(). for(i. gotoxy(6.i+2). gotoxy(32. gotoxy(66.i).close(). getch().} void main() . cout<<lme. cout<<fme. cout<<sno. } }} g. while(g.} sno++.int i=8.i).read((char*)this. getch(). if(i==44) { i=8.48). e. gotoxy(22.i). cout<<"011-"<<v. gotoxy(10. cout<<ofad.i).i++) {gotoxy(3.

clrscr(). k. getch(). } .showmain(). textcolor(RED).{ textbackground(BLACK). emp k.

Sign up to vote on this title
UsefulNot useful