You are on page 1of 52

//kathmandu Engineering COllege,kalimati,Kathmandu ,Nepal //Submitted as a first semester project to department of //computer and Electronics //aryalnz@gmail.com,nazararyal@yahoo.com //http://www.facebook.com/nazar.

aryal //my first project in C #include <graphics.h> #include <stdio.h> #include <conio.h> #include <dos.h> #include <stdlib.h> #include <string.h> struct record { char name[30]; char type[15]; char dday[10]; char dtime[10]; char aday[10]; char atime[10]; char des[30]; int capa; } airline; struct record1 { char name[20]; char addr[40]; char pnum[15]; char dob[15]; char nic[15]; char pass[15]; char nation[20]; char dest[30]; char airline[20]; char dod[10]; char time[10]; }customer; void modify(); int password(); void onexit(); // // STRUCTURE FOR AIRLINE WITH THEIR ELEMENTS

// STRUCTURE FOR CUSTOMERS

//

AND THEIR ELEMENTS

int selection (int,int*,int); void display(); void customerf(void); void airlinef(void); void start(void); void add_airline(void); void edit_airline(); void delete_airline(void); void add_customer(void); void edit_customer(void); void delete_customer(void); void view_airline(void); void view_customer(void); void option(void); void option1(void); void option2(void); void inv(void); #define size 35 int c=0,d=0; int i,j,f=0; void mainm(void); void entry(void); void modify(void); void delet(void); void view(void); // Structure struct hoteldata { char name[size][30], nic[size][20],rdate[size][12],cdate[size][12]; }; struct hoteldata guest; struct hoteldata1 { char name[size][30], nic[size][20],rdate[size][12],cdate[size][12]; }guest1;

//

IN THE PROGRAMS

int li,lp,sr[size];int dr[size];int rno;int i;int e; char rc,ch,choice,echoice,rchoice,temp[80],vchoice,mf,ar;

void main() { int gdriver,gmode,arrow,choice,*position,verify,chance;char chh; clrscr(); /*lets verify user*/ if(f==1)goto aa; verify=password(); if(verify!=1)exit(0); aa:f=0; detectgraph(&gdriver,&gmode); initgraph(&gdriver,&gmode,"c:\\tc\\bgi"); do { display(); *position=200,*(position+1)=210; choice=1; for(;;) { choice=selection(choice,position,12); chh=getch(); if(chh==13)break; } cleardevice(); switch(choice) { case 1:airlinef();break; case 2: cleardevice(); setbkcolor(BLUE); setcolor(RED+BLINK); moveto(200,200);outtext("SORRY !! TRAIN TICKETING NOT A VILIABLE NOW!!"); getch(); cleardevice(); setbkcolor(BLACK);

break; case 3: cleardevice(); setbkcolor(BLUE); setcolor(RED+BLINK); moveto(200,200);outtext("SORRY !! BUS TICKETING NOT AVIL IABLE NOW!!"); getch(); cleardevice(); setbkcolor(BLACK); break; case 4:mainm();break; case 5: case 6: case 7: case 8:customerf();break; case 9: case 10: case 11: modify(); break; } } while(choice!=12); onexit(); closegraph(); }

void onexit() { int gdriver,gmode,k; detectgraph(&gdriver,&gmode); initgraph(&gdriver,&gmode,"..\\bgi"); settextstyle(4,0,6);outtext("THANK YOU"); delay(500); cleardevice(); for(i=0;i<200;i+=2) { settextstyle(0,0,0);

setcolor(i); setlinestyle(1,3,7); rectangle(i-10,i-10,640-i,460-i); for(j=1;j<=15;j++) { arc(320,240-j+i,500-j-i,j+i,360); arc(320,240+j-i,500-j,j,360); } setcolor(7); moveto(40+i,200);outtext("DESIGNED BY:"); moveto(65+i,210);outtext("BCT"); moveto(40+i,220);outtext(" NAJAR ARYAL"); moveto(550-i,210);outtext("I/I)"); moveto(442-i,230);outtext("ALOK KHATRI"); moveto(440-i,240);outtext("KRISHNA ARYAL"); moveto(40+i,250);outtext("GEHENDRA SHARMA"); delay(20); cleardevice(); } for(j=1;j<=300;j+=2) { setcolor(i); rectangle(i-20-j,i-20-j,640-i+j,460-i+j); for(k=1;k<=15;k++) { arc(320,240+k-j,60-j+k,j+k,360); arc(320,240-k+j,60+j-k,j,360); } setcolor(RED); moveto(40+i,190-j);outtext("DESIGNED BY:"); bar(30+i,200-j,150+i,202-j); moveto(65+i,210-j);outtext("BCT"); moveto(43+i,220-j);outtext(" NAJAR ARYAL"); moveto(500-i,210-j);outtext("I/I)"); moveto(450-i,230-j );outtext("ALOK KHATRI"); moveto(443-i,240-j);outtext("KRISHNA ARYAL"); moveto(38+i,250-j);outtext("GEHENDRA SHARMA"); delay(25); cleardevice(); } }

/*select from list using arrow*/ int selection(int cho2,int *position,int max) { char ch1; int loop,arrow,ch; setcolor(3); do { display(); ch1 = getche(); ch=ch1; if ( ch==72) arrow=1; if ( ch==80) arrow=2; if(arrow==1||arrow==2) loop=1; }while(loop!=1); /*for line selection*/ if(cho2>=1&&cho2<=max) { if(cho2>1&&arrow==1) { cleardevice(); bar(240,*position-10,460,*(position+1)-10); *position-=10;*(position+1)-=10; display(); cho2--; } if(cho2<max&&arrow==2) { cleardevice(); bar(240,*position+10,460,*(position+1)+10); *position+=10;*(position+1)+=10; display(); cho2++; } } return(cho2);

} void display() { setcolor(BROWN); settextstyle(3,0,8); moveto(20,10);outtext("TRAVEL AGENCY MANAGEMENT SYSTEM" ); settextstyle(0,0,0); setcolor(RED); moveto(250,200);outtext("1.Airline TICKETING"); moveto(250,210);outtext("2.RAILWAY TICKETING"); moveto(250,220);outtext("3.BUS TICKETING"); moveto(250,230);outtext("4.HOTEL RESERVATION"); moveto(250,240);outtext("5.PLACES IN NEPAL TO VISIT"); moveto(250,250);outtext("6.PACKAGES AVILIABLE"); moveto(250,260);outtext("7.MILEAGE POINTS"); moveto(250,270);outtext("8.COSTUMER DETAILS"); moveto(250,280);outtext("9.GUIDE LINKS"); moveto(250,290);outtext("10.CITY TOUR"); moveto(250,300);outtext("11.Change Password"); moveto(250,310);outtext("12.EXIT"); setcolor(GREEN); moveto(0,422); outtext("============================================== ============="); moveto(5,430); setcolor(GREEN); outtext("USE ARROW KEYS AND PRESS ENTER TO SELECT.......... " ); moveto(0,438); outtext("============================================== ============="); setcolor(BLUE); setlinestyle(1,2,8); rectangle(235,195,465,325); } /*password Checking function*/ int password() {

FILE *fptr; int gdriver,gmode,arrow,col,i,j,len,len2,check,checku,checkp,chance=0; char user[15],pass[15],userf,passf; clrscr(); detectgraph(&gdriver,&gmode); initgraph(&gdriver,&gmode,"c:\\tc\\bgi"); do { cleardevice(); setcolor(WHITE); col=0; for(i=1;i<=100;i++) { if(i%5==0)col++; setcolor(col); arc(326,227,47+(3*i),0+6*i,360-i); } for(i=1;i<=10;i++) { setcolor(1); rectangle(145-i,145-i,510+i,305+i); } setfillstyle(SOLID_FILL,0); bar(150,150,500,200); setlinestyle(DOTTED_LINE,2,7); line(150,201,500,201); setfillstyle(SOLID_FILL,0); bar(150,202,500,251); setlinestyle(DOTTED_LINE,2,6); line(150,251,500,251); setfillstyle(SOLID_FILL,0); bar(150,251,500,300); setcolor(13); settextstyle(3,0,2);moveto(155,160);outtext("PASSWORD VERIFICATI ON CONSOLE"); settextstyle(0,0,0);moveto(160,230);outtext("ENTER USERNAME:"); settextstyle(0,0,0);moveto(160,260);outtext("ENTER PASSWORD:"); setcolor(WHITE); rectangle(280,220,430,240); setcolor(RED); rectangle(280,255,430,275); setfillstyle(SOLID_FILL,7);

bar(0,450,640,470); moveto(100,455);setcolor(RED);outtext("ONLY ALPHABETS AND NU MBERS ALLOWED:Password OF SIZE(6-13)"); len=0; do { if(len==14) break; setcolor(0); user[len]=getch(); check=user[len]; if((check>=48&&check<=57)||(check>=65&&check<=90)||(check>=97&&c heck<=122)||check==13) { if(len<=5&&check==13) {check=1;continue;} gotoxy(37+len,15);textcolor(WHITE);putchar(user[len]); len++; } else if(check==8) { if(len>0) { gotoxy(37+len-1,15);printf(" "); len--; } } else continue; }while(check!=13); user[len]='\0'; len2=0; setcolor(RED); rectangle(280,220,430,240); setcolor(WHITE);

rectangle(280,255,430,275); do { if(len2==14) break; setcolor(0); pass[len2]=getch(); check=pass[len2]; if((check>=48&&check<=57)||(check>=65&&check<=90)||(chec k>=97&&check<=122)||check==13) { if(len2<=5&&check==13) {check=1;continue;} if(check!=13) { gotoxy(37+len2,17);textcolor(WHITE);putchar('#'); } len2++; } else if(check==8) { if(len2>0) { gotoxy(37+len2-1,17);printf(" "); len2--; } } else continue; }while(check!=13); pass[len2]='\0'; fptr=fopen("password.txt","r"); if(fptr==NULL) { cleardevice(); setcolor(BLUE); moveto(100,200);outtext(".......SORRY PASSWORD FILE CORRUPTED.. ....."); moveto(100,220);outtext(".........EXITING....."); moveto(100,250);outtext("......Press any KEY.......");

getch(); exit(0); } i=0; do { userf=fgetc(fptr); if (userf!=user[i]) {checku=0;break;} cleardevice(); i++; checku=1; }while(i!=(len-1)); j=0; do { passf=fgetc(fptr); if (passf!=pass[j]) {checkp=0;break;} j++; checkp=1; }while(j!=(len2-1)); fclose(fptr); if(checku==1&&checkp==1) { return(1); } else { setcolor(RED); moveto(200,375);outtext("INCORRECT PASSWORD"); textattr(WHITE+BLINK);gotoxy(30,20);printf("YOU HAVE %d CHANCE S",2-chance); moveto(200,400);outtext("PRESS ANY KEY TO RETRY"); getch(); chance++; } } while(chance!=3); return 0; }

/*modify Password*/ void modify() { FILE *fptr; int gdriver,gmode,arrow,i,j,len,len2,check,checku,checkp; char user[15],pass[15],userf[15],passf[15]; detectgraph(&gdriver,&gmode); initgraph(&gdriver,&gmode,"c:\\tc\\bgi"); cleardevice(); setcolor(WHITE); setfillstyle(SOLID_FILL,0); bar(150,150,500,200); setlinestyle(DOTTED_LINE,2,7); line(150,201,500,201); setfillstyle(SOLID_FILL,0); bar(150,202,500,251); setlinestyle(DOTTED_LINE,2,6); line(150,251,500,251); setfillstyle(SOLID_FILL,0); bar(150,251,500,300); setcolor(13); settextstyle(3,0,2);moveto(155,160);outtext("PASSWORD MODIFICAT ION CONSOLE"); settextstyle(0,0,0);moveto(120,230);outtext("ENTER NEW USERNAME:") ; settextstyle(0,0,0);moveto(120,260);outtext("ENTER NEW PASSWORD:") ; setcolor(WHITE); rectangle(280,220,430,240); setcolor(RED); rectangle(280,255,430,275); setfillstyle(SOLID_FILL,7); bar(0,450,640,470); moveto(100,455);setcolor(RED);outtext("ONLY ALPHABETS AND NUM BERS ALLOWED:::Password OF SIZE(6-13)"); len=0; do { if(len==14) break; setcolor(0);

user[len]=getch(); check=user[len]; if((check>=48&&check<=57)||(check>=65&&check<=90)||(check>=97&&c heck<=122)||check==13) { if(len<=5&&check==13) {check=1;continue;} gotoxy(37+len,15);textcolor(WHITE);putchar(user[len]); len++; } else if(check==8) { if(len>0) { gotoxy(37+len-1,15);printf(" "); len--; } } else continue; }while(check!=13); user[len]='\0'; len2=0; setcolor(RED); rectangle(280,220,430,240); setcolor(WHITE); rectangle(280,255,430,275); do { if(len2==14) break; setcolor(0); pass[len2]=getch(); check=pass[len2]; if((check>=48&&check<=57)||(check>=65&&check<=90)||(chec k>=97&&check<=122)||check==13) { if(len2<=5&&check==13)

{check=1;continue;} gotoxy(37+len2,17);textcolor(WHITE);putchar('#'); len2++; } else if(check==8) { if(len2>0) { gotoxy(37+len2-1,17);printf(" "); len2--; } } else continue; }while(check!=13); fptr=fopen("password.txt","w"); i=0; do { fputc(user[i],fptr); i++; } while(i!=len); i=0; do { fputc(pass[i],fptr); i++; } while(i!=(len2-1)); fclose(fptr); cleardevice(); setcolor(RED); moveto(120,300);outtext("YOU SUCCESSFULLY CHANGED PASSWOR D"); moveto(100,320);outtext("PRESS ANY KEY.........."); getch(); cleardevice(); }

void start(void) { // FUNTION USED FOR MAKING THE setcolor(RED); setlinestyle(SOLID_LINE,1,3); rectangle(0,0,639,479); // RECTANGLE WHICH IS THE BOR DER setcolor(BLUE); setlinestyle(SOLID_LINE,1,2); .. rectangle(10,10,629,469); } // ... COLORS ARE USED IN THEM

void airlinef(void) { d=0,c=0; cleardevice(); start(); settextstyle(TRIPLEX_FONT,HORIZ_DIR,6); setcolor(LIGHTBLUE); outtextxy(25,40," AIRLINE INFORMATION"); setcolor(YELLOW); settextstyle(TRIPLEX_FONT,HORIZ_DIR,4); outtextxy(60,150,"1)ADD AIRLINE INFORMATION"); outtextxy(60,210,"2)DELETE AIRLINE INFORMATION"); outtextxy(60,270,"3)VIEW AIRLINE INFORMATION"); outtextxy(60,330,"4)EDIT AIRLINE INFORMATION"); outtextxy(60,390,"5)GO BACK TO THE MAIN MENU"); switch(getch()) { case '1': add_airline(); cleardevice(); airlinef(); break;

case '2': delete_airline(); cleardevice(); airlinef(); break; case '3': view_airline(); cleardevice(); airlinef(); break; case '4': edit_airline(); cleardevice(); airlinef(); break; case '5': cleardevice(); start(); aa: break; default : inv(); airlinef(); } } void customerf(void) { d=0,c=0; cleardevice(); start(); settextstyle(TRIPLEX_FONT,HORIZ_DIR,6); setcolor(LIGHTBLUE); outtextxy(13,40,"CUSTOMER INFORMATION"); setcolor(YELLOW); settextstyle(TRIPLEX_FONT,HORIZ_DIR,4);

outtextxy(60,150,"1)ADD CUSTOMER INFORMATION"); outtextxy(60,210,"2)DELETE CUSTOMER INFORMATION"); outtextxy(60,270,"3)VIEW CUSTOMER INFORMATION"); outtextxy(60,330,"4)EDIT CUSTOMER INFORMATION"); outtextxy(60,390,"5)GO BACK TO THE MAIN MENU"); switch(getch()) { case '1': add_customer(); cleardevice(); customerf(); break; case '2': delete_customer(); cleardevice(); customerf(); break; case '3': view_customer(); cleardevice(); customerf(); break; case '4': edit_customer(); cleardevice(); customerf(); break; case '5': cleardevice(); start(); aa: break; default : inv(); customerf(); } } void add_airline(void) {

FILE *fpoin; char temp[30]; int a=35; fpoin=fopen("airline.txt","a"); cleardevice(); start(); settextstyle(DEFAULT_FONT,HORIZ_DIR,3); outtextxy(35,40,"ADD AIRLINE INFORMATION"); settextstyle(DEFAULT_FONT,HORIZ_DIR,1); outtextxy(60,100,"ENTER AN AIRLINE NAME"); gotoxy(a,7); gets(temp); strcpy(airline.name,strupr(temp)); outtextxy(60,115,"ENTER A DESTINATION"); gotoxy(a,8); gets(temp); strcpy(airline.des,strupr(temp)); outtextxy(60,130,"ENTER AN AIRCRAFT TYPE"); gotoxy(a,9); gets(temp); strcpy(airline.type,strupr(temp)); outtextxy(60,145 ,"DAY OF DEPARTURE"); gotoxy(a,10); gets(temp); strcpy(airline.dday,strupr(temp)); outtextxy(60,160,"DEPARTURE TIME"); gotoxy(a,11); gets(temp); strcpy(airline.dtime,strupr(temp)); outtextxy(60,175,"ARRIVAL DAY"); gotoxy(a,12); gets(temp); strcpy(airline.aday,strupr(temp));

outtextxy(60,190,"ARRIVAL TIME"); gotoxy(a,13); gets(temp); strcpy(airline.atime,strupr(temp)); outtextxy(60,205,"CAPACITY"); gotoxy(a,14); scanf("%d",&airline.capa); fwrite(&airline, sizeof(airline),1, fpoin); if((c!=1)&&(d!=1)) { cleardevice(); start(); outtextxy(90,290,"RECORD ADDED"); outtextxy(90,310,"PRESS ANY KEY TO CONTINUE"); getch(); } fclose(fpoin); fflush(stdin); } void delete_airline(void) { char *searchname,*desname,temp1[30],temp[30]; int count=0,count1=0,success=0,i,j,success2=0,k=0; FILE *fpoin,*fpoin1; cleardevice(); start(); cleardevice(); start(); gotoxy(10,5); printf("ENTER THE NAME OF THE AIRLINE:"); gets(temp1); searchname=strupr(temp1);

gotoxy(10,7); printf("ENTER THE NAME OF DESTINATION:"); gets(temp); desname=strupr(temp); fpoin=fopen("airline.txt","r"); while((fread(&airline,sizeof(airline),1,fpoin))!=NULL) { count1++; if((strcmp(searchname,airline.name)==0)&&(strcmp(desname,airline. des)==0)) { success2=1; cleardevice(); start(); gotoxy(9,10); printf("AIRLINE NAME"); gotoxy(26,10); puts(airline.name); gotoxy(20,11); printf("\n\tDESTINATION\t %s \ \n\tAIRCRAFT TYPE\t %s \ \n\tDEPARTURE DAY\t %s \ \n\tDEPARTURE TIME\t %s \ \n\tARRIVAL DAY\t %s \ \n\tARRIVAL TIME\t %s \ \n\tCAPACITY\t %d",airline.des,airline.type,airline.dday,airlin e.dtime,airline.aday,airline.atime,airline.capa); printf("\n\n\n\n\n"); start(); count++; gotoxy(20,20); printf("(D)ELETE OR MOVE (F)URTHER"); switch(getch()) { case 'D': case 'd': k=1; success=1; break;

case 'F': case 'f': break; default : success=2; inv(); } if(success==1) break; } } if((success2==1)&&(success==1)) { rewind(fpoin); fpoin1=fopen("temp.txt","w"); for(i=1;i<count1;i++) { fread(&airline,sizeof(airline),1,fpoin); fwrite(&airline, sizeof(airline),1,fpoin1); } for(j=0;j<=3;j++) { cleardevice(); start(); settextstyle(TRIPLEX_FONT,HORIZ_DIR,2); setcolor(WHITE); outtextxy(100,150,"RECORD DELETING"); delay(700); setcolor(BLACK); outtextxy(100,150,"RECORD DELETING"); delay(700); setcolor(WHITE); } cleardevice();

start(); setcolor(RED); outtextxy(100,170,"RECORD DELETED"); delay(1500); fread(&airline,sizeof(airline),1,fpoin); while((fread(&airline,sizeof(airline),1,fpoin))!=NULL) fwrite(&airline, sizeof(airline),1,fpoin1); start();

fclose(fpoin1); fclose(fpoin); remove("airline.txt"); rename("temp.txt","airline.txt"); fpoin=fopen("airline.txt","r"); } if(success2==0) { gotoxy(28,20); printf("RECORD NOT FOUND"); getch(); } if((count!=0)&&(k==0)) { gotoxy(10,22); printf("THERE ARE %d RECORD(S) LEFT",count); getch(); } } void view_airline(void) { cleardevice(); setcolor(4);

settextstyle(3,0,5); outtextxy(40,100,"PRESS"); setcolor(11); settextstyle(3,0,3); outtextxy(70,200,"1 - TO SEARCH BY NAME"); outtextxy(70,240,"2 - TO SEARCH BY DESTINATION"); outtextxy(70,280,"3 - TO SEARCH BY BOTH"); outtextxy(70,320,"4 - TO GO BACK"); start(); switch(getch()) { case '1': option1(); view_airline(); break; case '2': option(); view_airline(); break; case '3': option2(); view_airline(); break; case '4': airlinef(); break; default : inv(); view_airline(); } fflush(stdin); } void option(void) { FILE *fpoin; char *searchname,temp[30]; int count=0;

cleardevice(); start(); gotoxy(10,5); printf("Enter the name of destination to search:"); gets(temp); searchname=strupr(temp); fpoin=fopen("airline.txt","r"); while((fread(&airline,sizeof(airline),1,fpoin))!=NULL) { if(strcmp(searchname,airline.des)==0) { cleardevice(); start(); gotoxy(9,10); printf("AIRLINE NAME"); gotoxy(26,10); puts(airline.name); gotoxy(20,11); printf("\n\tDESTINATION\t %s \ \n\tAIRCRAFT TYPE\t %s \ \n\tDEPARTURE DAY\t %s \ \n\tDEPARTURE TIME\t %s \ \n\tARRIVAL DAY\t %s \ \n\tARRIVAL TIME\t %s \ \n\tCAPACITY\t %d",airline.des,airline.type,airline.dday,airli ne.dtime,airline.aday,airline.atime,airline.capa); printf("\n\n\n\n\n"); start(); count++; getch(); } } printf("\n\n\t\t\tTHERE ARE %d RECORD(S)",count); start(); getch();

} void option1(void) { FILE *fpoin; char *searchname,temp[30]; int count=0; cleardevice(); start(); gotoxy(10,5); printf("Enter the name of airline to search:"); gets(temp); searchname=strupr(temp); fpoin=fopen("airline.txt","r"); while((fread(&airline,sizeof(airline),1,fpoin))!=NULL) { if(strcmp(searchname,airline.name)==0) { cleardevice(); start(); gotoxy(9,10); printf("AIRLINE NAME"); gotoxy(26,10); puts(airline.name); gotoxy(20,11); printf("\n\tDESTINATION\t %s \ \n\tAIRCRAFT TYPE\t %s \ \n\tDEPARTURE DAY\t %s \ \n\tDEPARTURE TIME\t %s \ \n\tARRIVAL DAY\t %s \ \n\tARRIVAL TIME\t %s \ \n\tCAPACITY\t %d",airline.des,airline.type,airline.dday,airli ne.dtime,airline.aday,airline.atime,airline.capa); printf("\n\n\n\n\n"); start(); count++;

getch(); } } printf("\n\n\t\t\tTHERE ARE %d RECORD(S)",count); start(); getch(); } void option2(void) { FILE *fpoin; char *searchname,*desname,temp[30],temp1[30]; int count=0; cleardevice(); start(); gotoxy(10,5); printf("ENTER AIRLINE:"); gets(temp1); searchname=strupr(temp1); gotoxy(10,10); printf("ENTER DESTINATION:"); gets(temp); desname=strupr(temp); fpoin=fopen("airline.txt","r"); while((fread(&airline,sizeof(airline),1,fpoin))!=NULL) { if((strcmp(searchname,airline.name)==0)&&(strcmp(desname,airline.de s)==0)) { cleardevice(); start(); gotoxy(9,10); printf("AIRLINE NAME"); gotoxy(26,10); puts(airline.name);

gotoxy(20,11); printf("\n\tDESTINATION\t %s \ \n\tAIRCRAFT TYPE\t %s \ \n\tDEPARTURE DAY\t %s \ \n\tDEPARTURE TIME\t %s \ \n\tARRIVAL DAY\t %s \ \n\tARRIVAL TIME\t %s \ \n\tCAPACITY\t %d",airline.des,airline.type,airline.dday,airli ne.dtime,airline.aday,airline.atime,airline.capa); printf("\n\n\n\n\n"); start(); count++; getch(); } } printf("\n\n\t\t\tTHERE ARE %d RECORD(S)",count); start(); getch(); } void edit_airline() { char *searchname,*desname,temp1[30],temp[30]; int count=0,count1=0,success=0,i,j,k=0,success2=0; FILE *fpoin,*fpoin1; cleardevice(); start(); cleardevice(); start(); gotoxy(10,5); printf("ENTER THE NAME OF THE AIRLINE:"); gets(temp1); searchname=strupr(temp1); gotoxy(10,7); printf("ENTER THE NAME OF DESTINATION:"); gets(temp); desname=strupr(temp);

fpoin=fopen("airline.txt","r"); while((fread(&airline,sizeof(airline),1,fpoin))!=NULL) { count1++; if((strcmp(searchname,airline.name)==0)&&(strcmp(desname,airline. des)==0)) { success2=1; cleardevice(); start(); gotoxy(9,10); printf("AIRLINE NAME"); gotoxy(26,10); puts(airline.name); gotoxy(20,11); printf("\n\tDESTINATION\t %s \ \n\tAIRCRAFT TYPE\t %s \ \n\tDEPARTURE DAY\t %s \ \n\tDEPARTURE TIME\t %s \ \n\tARRIVAL DAY\t %s \ \n\tARRIVAL TIME\t %s \ \n\tCAPACITY\t %d",airline.des,airline.type,airline.dday,airlin e.dtime,airline.aday,airline.atime,airline.capa); printf("\n\n\n\n\n"); start(); count++; gotoxy(20,20); printf(" (E)DIT OR (N)EXT RECORD"); switch(getch()) { case 'e': case 'E': k=1; success=1; break; case 'N': case 'n': break; default :

success=2; inv(); } if(success==1) break; } }

if((success2==1)&&(success==1)) { rewind(fpoin); fpoin1=fopen("temp.txt","w"); for(i=1;i<count1;i++) { fread(&airline,sizeof(airline),1,fpoin); fwrite(&airline, sizeof(airline),1,fpoin1); } fread(&airline,sizeof(airline),1,fpoin); d=1; c=1; add_airline(); for(j=0;j<=5;j++) { cleardevice(); start(); settextstyle(TRIPLEX_FONT,HORIZ_DIR,2); setcolor(WHITE); outtextxy(100,150,"RECORD MODIFYING"); delay(700); setcolor(BLACK); outtextxy(100,150,"RECORD MODIFYING"); delay(700); setcolor(WHITE);

} cleardevice(); start(); setcolor(RED); outtextxy(100,170,"RECORD MODIFIED"); delay(1500); while((fread(&airline,sizeof(airline),1,fpoin))!=NULL) fwrite(&airline, sizeof(airline),1,fpoin1); start();

fclose(fpoin1); fclose(fpoin); remove("airline.txt"); rename("temp.txt","airline.txt"); fpoin=fopen("airline.txt","r"); } if(success2==0) { gotoxy(28,20); printf("RECORD NOT FOUND"); getch(); } if((count!=0)&&(k==0)) { gotoxy(10,22); printf("THERE ARE %d RECORD(S) LEFT",count); getch(); } } void add_customer(void) {

FILE *fpoin1; char temp[30]; int a=35; fpoin1=fopen("customer.txt","a"); cleardevice(); start(); settextstyle(DEFAULT_FONT,HORIZ_DIR,3); outtextxy(35,40,"ADD CUSTOMER INFORMATION"); settextstyle(DEFAULT_FONT,HORIZ_DIR,1); outtextxy(60,100,"ENTER CUSTOMER NAME"); gotoxy(a,7); gets(temp); strcpy(customer.name,strupr(temp)); outtextxy(60,115,"ENTER ADDRESS"); gotoxy(a,8); gets(temp); strcpy(customer.addr,strupr(temp)); outtextxy(60,130,"ENTER PHONE NUMBER"); gotoxy(a,9); gets(temp); strcpy(customer.pnum,strupr(temp)); outtextxy(60,145 ,"DATE OF BIRTH"); gotoxy(a,10); gets(temp); strcpy(customer.dob,strupr(temp)); outtextxy(60,160,"NIC NUMBER"); gotoxy(a,11); gets(temp); strcpy(customer.nic,strupr(temp)); outtextxy(60,175,"PASSPORT NUMBER"); gotoxy(a,12); gets(temp); strcpy(customer.pass,strupr(temp));

outtextxy(60,190,"NATIONALITY"); gotoxy(a,13); gets(temp); strcpy(customer.nation,strupr(temp)); outtextxy(60,205,"DESTINATION"); gotoxy(a,14); gets(temp); strcpy(customer.dest,strupr(temp)); outtextxy(60,220,"ENTER AIRLINE"); gotoxy(a,15); gets(temp); strcpy(customer.airline,strupr(temp)); outtextxy(60,235,"DATE OF DEPARTURE"); gotoxy(a,16); gets(temp); strcpy(customer.dod,strupr(temp)); outtextxy(60,250,"TIME OF DEPARTURE"); gotoxy(a,17); gets(temp); strcpy(customer.time,strupr(temp)); if((c!=1)&&(d!=1)) { cleardevice(); start(); outtextxy(90,290,"RECORD ADDED"); outtextxy(90,310,"PRESS ANY KEY TO CONTINUE"); getch(); } fwrite(&customer, sizeof(customer),1, fpoin1); fclose(fpoin1); fflush(stdin); } void edit_customer(void)

{ char *searchname,temp[30]; int count=0,count1=0,success=0,i,j,success2=0,k=0; FILE *fpoin1,*fpoin2; cleardevice(); start(); cleardevice(); start(); gotoxy(10,5); printf("ENTER THE NAME OF CUSTOMER:"); gets(temp); searchname=strupr(temp); gotoxy(10,7); fpoin1=fopen("customer.txt","r"); while((fread(&customer,sizeof(customer),1,fpoin1))!=NULL) { count1++; if((strcmp(searchname,customer.name)==0)) { success2=1; cleardevice(); start(); gotoxy(9,10); printf("CUSTOMER NAME"); gotoxy(34,10); puts(customer.name); gotoxy(20,11); printf("\n\tADDRESS\t\t\t %s \ \n\tPHONE NUMBER\t\t %s \ \n\tDATE OF BIRTH\t\t %s \ \n\tNIC NUMBER\t\t %s \ \n\tPASSPORT NUMBER\t\t %s \ \n\tNATIONALITY\t\t %s \ \n\tDESTINATION\t\t %s \ \n\tAIRLINE\t\t\t %s \ \n\tDAY OF DEPARTURE\t %s \ \n\tTIME OF DEPARTURE\t %s",customer.addr,customer.pnum, customer.dob,customer.nic,customer.pass,customer.nation,customer.dest,cu

stomer.airline,customer.dod,customer.time); start(); count++; gotoxy(20,23); printf("(E)DIT OR MOVE (F)URTHER"); switch(getch()) { case 'E': case 'e': k=1; success=1; break; case 'F': case 'f': break; default : success=2; inv(); } if(success==1) break; } } if((success2==1)&&(success==1)) { i=1; rewind(fpoin1); fpoin2=fopen("temp.txt","w"); for(i=1;i<count1;i++) { fread(&customer,sizeof(customer),1,fpoin1); fwrite(&customer,sizeof(customer),1,fpoin2); }

fread(&customer,sizeof(customer),1,fpoin1); c=1; d=1; add_customer(); while((fread(&customer,sizeof(customer),1,fpoin1))!=NULL) fwrite(&customer, sizeof(customer),1,fpoin2);

for(j=0;j<=3;j++) { cleardevice(); start(); settextstyle(TRIPLEX_FONT,HORIZ_DIR,2); setcolor(WHITE); outtextxy(100,150,"RECORD MODIFYING"); delay(700); setcolor(BLACK); outtextxy(100,150,"RECORD MODIFYING"); delay(700); setcolor(WHITE); } start(); cleardevice(); start(); setcolor(RED); outtextxy(100,170,"RECORD MODIFIED"); delay(1500);

fclose(fpoin2); fclose(fpoin1); remove("customer.txt"); rename("temp.txt","customer.txt");

fpoin1=fopen("customer.txt","r"); } if(success2==0) { gotoxy(28,20); printf("RECORD NOT FOUND"); getch(); } if((count!=0)&&(k==0)) { gotoxy(10,24); printf("THERE ARE %d RECORD(S) LEFT",count); getch(); } } void delete_customer(void) { char *searchname,temp[30]; int count=0,count1=0,success=0,i,j,success2=0,k=0; FILE *fpoin1,*fpoin2; cleardevice(); start(); cleardevice(); start(); gotoxy(10,5); printf("ENTER THE NAME OF CUSTOMER:"); gets(temp); searchname=strupr(temp); gotoxy(10,7); fpoin1=fopen("customer.txt","r"); while((fread(&customer,sizeof(customer),1,fpoin1))!=NULL) { count1++; if((strcmp(searchname,customer.name)==0))

{ success2=1; cleardevice(); start(); gotoxy(9,10); printf("CUSTOMER NAME"); gotoxy(34,10); puts(customer.name); gotoxy(20,11); printf("\n\tADDRESS\t\t\t %s \ \n\tPHONE NUMBER\t\t %s \ \n\tDATE OF BIRTH\t\t %s \ \n\tNIC NUMBER\t\t %s \ \n\tPASSPORT NUMBER\t\t %s \ \n\tNATIONALITY\t\t %s \ \n\tDESTINATION\t\t %s \ \n\tAIRLINE\t\t\t %s \ \n\tDAY OF DEPARTURE\t %s \ \n\tTIME OF DEPARTURE\t %s",customer.addr,customer.pnum, customer.dob,customer.nic,customer.pass,customer.nation,customer.dest,cu stomer.airline,customer.dod,customer.time); start(); count++; gotoxy(10,23); printf("(D)ELETE OR MOVE (F)URTHER"); switch(getch()) { case 'D': case 'd': k=1; success=1; break; case 'F': case 'f': break; default : success=2; inv();

} if(success==1) break; } } if((success2==1)&&(success==1)) { i=1; rewind(fpoin1); fpoin2=fopen("temp.txt","w"); for(i=1;i<count1;i++) { fread(&customer,sizeof(customer),1,fpoin1); fwrite(&customer,sizeof(customer),1,fpoin2); }

fread(&customer,sizeof(customer),1,fpoin1); while((fread(&customer,sizeof(customer),1,fpoin1))!=NULL) fwrite(&customer, sizeof(customer),1,fpoin2);

for(j=0;j<=3;j++) { cleardevice(); start(); settextstyle(TRIPLEX_FONT,HORIZ_DIR,2); setcolor(WHITE); outtextxy(100,150,"RECORD DELETING"); delay(700); setcolor(BLACK); outtextxy(100,150,"RECORD DELETING"); delay(700); setcolor(WHITE);

} start(); cleardevice(); start(); setcolor(RED); outtextxy(100,170,"RECORD DELETED"); delay(1500);

fclose(fpoin2); fclose(fpoin1); remove("customer.txt"); rename("temp.txt","customer.txt"); fpoin1=fopen("customer.txt","r"); } if(success2==0) { gotoxy(28,20); printf("RECORD NOT FOUND"); getch(); } if((count!=0)&&(k==0)) { gotoxy(10,24); printf("THERE ARE %d RECORD(S) LEFT",count); getch(); } } void view_customer(void) { FILE *fpoin1; char *searchname,temp[30];

int count=0; cleardevice(); start(); gotoxy(10,5); printf("Enter the name of customer to search:"); gets(temp); searchname=strupr(temp); fpoin1=fopen("customer.txt","r"); while((fread(&customer,sizeof(customer),1,fpoin1))!=NULL) { if(strcmp(searchname,customer.name)==0) { cleardevice(); start(); gotoxy(9,10); printf("CUSTOMER NAME"); gotoxy(34,10); puts(customer.name); gotoxy(20,11); printf("\n\tADDRESS\t\t\t %s \ \n\tPHONE NUMBER\t\t %s \ \n\tDATE OF BIRTH\t\t %s \ \n\tNIC NUMBER\t\t %s \ \n\tPASSPORT NUMBER\t\t %s \ \n\tNATIONALITY\t\t %s \ \n\tDESTINATION\t\t %s \ \n\tAIRLINE\t\t\t %s \ \n\tDAY OF DEPARTURE\t %s \ \n\tTIME OF DEPARTURE\t %s",customer.addr,customer.pnum, customer.dob,customer.nic,customer.pass,customer.nation,customer.dest,cu stomer.airline,customer.dod,customer.time); printf("\n\n\n\n"); start(); count++; getch(); }

} printf("\n\t\t\tTHERE ARE %d RECORD(S)",count); start(); getch(); } void inv(void) { sound(700); outtextxy(300,430,"INVALID INPUT"); delay(500); nosound(); setcolor(0); outtextxy(300,430,"INVALID INPUT"); }

// Initializations int li,lp,sr[size];int dr[size];int rno;int i;int e; char rc,ch,choice,echoice,rchoice,temp[80],vchoice,mf,ar; void mainm(void) { closegraph(); clrscr(); for(li=30;li<=50;li++) { gotoxy(li,20); delay(10); printf("*"); } for(li=50;li>=30;li--) { gotoxy(li,5); delay(10); printf("*"); }

for(lp=1;lp<60;lp++) { gotoxy(30,lp); delay(10); printf("|"); } for(lp=60;lp>=1;lp--) { gotoxy(50,lp); delay(10); printf("|"); } gotoxy(15,5); textcolor(LIGHTGRAY); cprintf("Press the corresponding Keys for the desired action"); gotoxy(33,9); textcolor(BROWN); cprintf("R: Reservation"); gotoxy(33,13); textcolor(LIGHTMAGENTA); cprintf("V: Room Status"); gotoxy(33,15); textcolor(LIGHTBLUE); cprintf("M: Modification"); gotoxy(33,17); textcolor(LIGHTRED); cprintf("D: Deletion"); gotoxy(33,19); textcolor(GREEN); cprintf("Q: Quit"); textcolor(WHITE); choice=getch(); switch(choice) {// Choice Switch Begin case 'R':case 'r': entry();break; case 'V':case 'v': view();break; case 'M':case 'm': modify();break; case 'D':case 'd': delet();break;

case 'Q':case 'q': f=1;main();break; default: {//Choice Default gotoxy(33,40); printf("\n\nIllegal Choice "); getch(); mainm(); }//Choice Default End } //Choice Switch End } //Main Menu Function End

// Data Entry Function void entry(void) {//Data Entry Function Begin FILE *fptr; fptr=fopen("hotel.txt","a+"); clrscr(); printf("Do You Want To reserve A Room? (Y/N)\n"); echoice=getch(); switch(echoice) // Echoice Switch Begin { case 'Y':case 'y': { // E-Choice Case Y Begin printf("\n\nEnter S for Single Room or D for Double Room\n\n"); rchoice=getch(); switch(rchoice) // Rchoice Switch Begin { case 'S': case 's':// Rchoice {// R-Choice Case S Begin for(i=1;i<size;i++) if(sr[i]==0) {// Single Room IF begin clrscr(); sr[i]=1; printf("\n\nRoom No : %d Is available For Reservation",i); printf("\n\nEnter Occupant's Name\n"); gets(guest.name[i]);

printf("\n\nEnter Occupant's NIC Number\n"); gets(guest.nic[i]); printf("\n\nEnter Check In Date\n"); gets(guest.rdate[i]); printf("\n\nEnter Check Out Date\n"); gets(guest.cdate[i]); printf("\n\n\n\nDo You Want To Reserve Another Room? Y/N"); ar=getch(); switch (ar) {// AR Switch Begin case 'Y': entry(); case 'N': case 'n': mainm(); default: {//AR Default Begin printf("\n\nIllegal Choice"); getch(); mainm(); }//AR Default End }// AR Switch End }// Single Room IF End }// Rchoice Case S End case 'D':case 'd': { //Rchoice Case D Begin for(i=1;i<size;i++) if(dr[i]==0) {// Double Room IF begin clrscr(); dr[i]=1; printf("\n\nRoom No : %d Is available For Reservation",i); printf("\n\nEnter Occupant's Name\n"); gets(guest1.name[i]); printf("\n\nEnter Occupant's NIC Number\n"); gets(guest1.nic[i]); printf("\n\nEnter Check In Date\n"); gets(guest1.rdate[i]); printf("\n\nEnter Check Out Date\n"); gets(guest1.cdate[i]);

printf("\n\n\n\nDo You Want To Reserve Another Room? Y/N"); ar=getch(); switch (ar) {// AR Switch Begin case 'Y':case 'y': entry(); case 'N': case 'n': mainm(); default: {//AR Default Begin printf("\n\nIllegal Choice or make sure CAPS Lock is on"); getch(); mainm(); }//AR Default End }// AR Switch End }// Double Room IF End }// Rchoice Case D End default: // Rchoice Default {//Rchoice Default Begin printf("\n\nIllegal Choice or make sure CAPS Lock is on"); getch(); mainm(); }//Rchoice default end }//Rchoice End }//Echoice Case Y End case 'N':case 'n': {// Echoice Case N Begin mainm(); }//Echoice Case N End default: //Echoice Default printf("\n\nIllegal Choice or make sure CAPS Lock is on"); getch(); mainm(); fclose(fptr); } // Echoice Default End } //Data Entry Function End // Data View Fucntion void view(void) {// Data View Function Begin clrscr();

printf("Press S for Sequential Display of the room status \ \n\nPress R for Manual Check Of Room Status\n\n"); vchoice=getch(); switch(vchoice) {//Vchoice Switch Begin case 'S':case 's': {//Vchoice Case S Begin clrscr(); printf("R.No.\tName\t\tNIC Number\tCheck In\tCheck Out\n"); for(i=1;i<size;i++) {//i Loop Begin if(sr[i]==1) {//SR[i]==1 Conditional Printing Begin printf("\n%d\t%s\t%s\t%s\t%s\n",i,guest.name[i],guest.nic[i], \ guest.rdate[i],guest.cdate[i]); }//SR[i]==1 Conditional Printing End }//i Loop End printf("\n\n\nPress Any Key For Double Room Status\n\n"); getch(); clrscr(); printf("R.No.\tName\t\tNIC Number\tCheck In\tCheck Out\n"); for(i=1;i<size;i++) {//i Loop Begin if(dr[i]==1) {//dr[i]==1 Conditional Printing Begin printf("\n%d\t%s\t%s\t%s\t%s\n",i,guest1.name[i],guest1.nic[i] \ ,guest1.rdate[i],guest1.cdate[i]); }//dr[i]==1 Conditional Printing End }//i Loop End printf("\n\n\nPress Any Key To Return To The Main Menu\n\n"); getch(); mainm(); }//Vchoice Case S End case 'R':case 'r': {// Vchoice case R Start clrscr(); printf("Enter The Room Number That Needs To Be Checked For \ Occupancy\n\n"); gets(temp); rno=atoi(temp);

// Room Number Limit Check if(rno<1 || rno >51) {//IF Condition Begin printf("\n\nIllegal Room Number"); getch(); mainm(); } //IF Condition End else { // Limit Else Falsified Begin if(sr[rno]==1) {//sr==1 if Begin printf("\n\nSingle Room No %d Is Reserved",rno); printf("\n\nOccupant's Name : %s \n\nOccupant's NIC Number : %s \\n\nChec k In Date : %s\n\nCheck Out Date : %s \n\n",guest.name[rno],guest.nic[rno ],guest.rdate[rno],guest.cdate[rno]); }//sr==1 if End else {// sr else begin printf("\n\nSingle Room No %d is Vacant",rno); getch(); }//sr else end if(dr[rno]==1) {//dr==1 if Begin printf("\n\nDouble Room No %d Is Reserved",rno); printf("\nOccupant's Name : %s \n\nOccupant's NIC Number : \%s \n\nCheck In Date : %s\n\nCheck Out Date : %s \n\n",guest1.name[rno],guest1.nic[rno ],guest1.rdate[rno],guest1.cdate[rno]); printf("\n\nPress Any Key To Return To The Main Menu"); getch(); mainm(); }//dr==1 if End else {// dr else begin printf("\n\nDouble Room No %d is Vacant",rno); getch(); mainm(); }//dr else end }//Vchoice Case R End }// Falsified Limit End default: {

//Vchoice Default Begin printf("\n\nIllegal Choice or make sure CAPS Lock is on"); getch(); mainm(); } // Vchoice Default End } // Vchoice Switch End } // Data View Function End

//Modify Function void brmodify(void) {// Modify Function Begin clrscr(); printf("\t\t\t\tData Modification\n\n\n\n\n\n"); printf("Enter The Room Number To Be Modified\n"); gets(temp); rno=atoi(temp); // Room Number Limit Check if(rno<1 || rno >51) {//IF Condition Begin printf("\n\nIllegal Room Number"); getch(); mainm(); } //IF Condition End else { // Limit Else Falsified Begin printf("Enter S For Single Room / D For Double Room\n"); rc=getch(); switch(rc) {//rc Switch Begin case 'S':case 's': {//rc Case S Begin if(sr[rno]==1) {//sr==1 if Begin clrscr(); printf("\n\nSingle Room No %d Is Reserved",rno); printf("\n\nOccupant's Name : %s \n\nOccupant's NIC Number : \ %s \n\nCheck In Date : %s\n\nCheck Out Date : %s \n\n", \ guest.name[rno],guest.nic[rno],guest.rdate[rno],guest.cdate[rno]); printf("\n\nPress N : Change Of Name\nI : Change In NIC\nR : \

Check In Date\nO : Check Out Date\n\n"); mf=getch(); switch(mf) {//mf switch Begin case 'N':case 'n': {//mf Case N Begin printf("\n\nEnter New Name\n"); gets(guest.name[rno]); getch(); mainm(); }//mf Case N End case 'I':case 'i': {//mf Case I Begin printf("\n\nEnter New NIC Number\n"); gets(guest.nic[rno]); getch(); mainm(); }//mf Case I End case 'R': case 'r': {//mf Case R Begin printf("\n\nEnter New Check In Date\n"); gets(guest.rdate[rno]); getch(); mainm(); }//mf Case R End case 'O':case 'o': {//mf Case O Begin printf("\n\nEnter New Check Out Date\n"); gets(guest.cdate[rno]); getch(); mainm(); }//mf Case O End default: {//mf Default Begin printf("\n\nInvalid Entry"); getch(); mainm(); }//mf Default End }//sr==1 if End } //rc Case S End else {// sr else begin

printf("\n\nSingle Room No %d is Vacant",rno); getch(); mainm(); }//sr else end }//rc Case S End case 'D': case 'd': {// rc Case D Begin if(dr[rno]==1) {//dr==1 if Begin clrscr(); printf("\n\nDouble Room No %d Is Reserved",rno); printf("\n\nOccupant's Name : %s \n\nOccupant's NIC Number : \ %s \n\nCheck In Date : %s\n\nCheck Out Date : %s \n\n",\ guest1.name[rno],guest1.nic[rno],guest1.rdate[rno],\ guest1.cdate[rno]); printf("\n\nPress N : Change Of Name\nI : Change \ In NIC\nR : Check In Date\nO : Check Out Date\n\n"); mf=getch(); switch(mf) {//mf switch Begin case 'N':case 'n': {//mf Case N Begin printf("\n\nEnter New Name\n"); gets(guest1.name[rno]); getch(); mainm(); }//mf Case N End case 'I': case 'i': {//mf Case I Begin printf("\n\nEnter New NIC Number\n"); gets(guest1.nic[rno]); getch(); mainm(); }//mf Case I End case 'R':case 'r': {//mf Case R Begin printf("\n\nEnter New Check In Date\n"); gets(guest1.rdate[rno]); getch(); mainm(); }//mf Case R End

case 'O':case 'o': {//mf Case O Begin printf("\n\nEnter New Check Out Date\n"); gets(guest1.cdate[rno]); getch(); mainm(); }//mf Case O End default: {//mf Default Begin printf("\n\nIllegal Choice or make sure CAPS Lock is on"); getch(); mainm(); }//mf Default End }//dr==1 if End }//rc Case D End else {// dr else begin printf("\n\nSingle Room No %d is Vacant",rno); getch(); mainm(); }//dr else end } // Case D End default: {// rc Default Begin printf("\n\n\nIllegal Entry "); getch(); mainm(); } // rc Default End } //Switch rc End } // Limit Else Falsified End } //Modify Function End //Delete Function void delet(void) {//Delete Function clrscr(); printf("Enter The Room Number To Vacate\n"); gets(temp); rno=atoi(temp); // Room Number Limit Check

if(rno<1 || rno >51) {//IF Condition Begin printf("\n\nIllegal Room Number"); getch(); mainm(); } //IF Condition End else {// Room Number Limit Falsified Else printf("\n\nSingle Or Double Room? (S/D)"); rc=getch(); switch(rc) {//rc Switch Begin case 'S': {//rc Case S Begin sr[rno]=0; printf("\n\nRoom Vacated"); printf("\n\nPress Any Key To Exit To The Main Menu"); getch(); mainm(); }// rc Case S End case 'D':case 'd': {//rc Case D Begin dr[rno]=0; printf("\n\nRoom Vacated"); printf("\n\nPress Any Key To Exit To The Main Menu"); getch(); mainm(); }//rc Case D End default: {//rc Default Begin printf("\n\nIllegal Choice"); getch(); mainm(); }// rc Default End }// rc Switch End }// Room Number Falsified Else End }// Delete Function End // END OF PROGRAM

You might also like