SlideShare a Scribd company logo
TERM PAPER 
ON 
“TICKET WINDOW AND AUTOMATION SYSTEM” 
FOR 
FOUNDATION OF COMPUTING (CSE 101) 
SUBMITTED TO: SUBMITTED BY: 
MISS SUKHDILPREET KAUR UTKARSH SINGH 
R246B33 
B.TECH(CSE)-MBA
Acknowledgement 
I am very thankful and expressing my deep sense of gratitude 
towards Miss Sukhdilpreet Kaur, Lecturer LSE, Lovely 
Professional University, who inspired me to work on this topic. 
I benefited a lot with discussing him on this topic. 
I am also thankful to my parents who provided me such a 
opportunity, for their inspiring words. 
I am also thankful to all my colleagues and all those who helped 
me in completion of this project. 
UTKARSH SINGH 
R246B33 
B.TECH(CSE)-MBA
TABLE OF CONTENTS 
1. INTRODUCTION TO C 
2. SOURCE CODE 
3. REQUIRED SOURCES 
4. REFRENCES
INTRODUCTION OF C 
As a programming language, C is rather like Pascal or FORTRAN. 
Values are sorted in variables. Programs structured by defining and 
calling functions. Program flow is controlled using loops, if statement 
and function calls. 
Input and output can be directed to the terminal or to the file 
.Related data can be sorted together in array or structures.Of the three 
languages, C allows the most precise control of input and output .C is 
also rather more terse than FORTRAN and PASCAL .this can result in 
short efficient programs where the programmer has made wise use of C 
range of powerful operators. It also allows the programmer to produce 
which are impossible to understand. 
Programmer who are familiar with the use of pointers (or 
indirect addressing, to use the correct term) will welcome the ease of 
use compared with some other languages .Undisciplined use of pointer 
can lead to errors which are very hard to trace .This course only deals 
with the simplest applications of pointers.
It is that newcomer will find C a useful and friendly language. Care 
must be taken in using C. many of the extra facilities which it offers can 
lead to extra types of programming error. You will have to learn to deal 
with these to successfully make the transition to being a C programmer. 
Why use C? 
C has been used successfully for every type of programming 
problem imaginable from operating systems to spreadsheets to expert 
system – and efficient compilers are available for machines ranging in 
power from the Apple Mocintosh to cray supercomputer. C is often 
called a “Middle Level” language. 
Use of C 
C was initially used for system development work, in particular the 
programs that make up operating system. Why use C? Mainly because 
it produces code written in assembly language. Some examples of the 
use of C might be: 
Operating system 
Language Compilers 
Assemblers
Text Editors 
Modern Programs 
Language Interpreters 
In recent year C has been use a general-purpose language because of 
it is not the world’s easiest language to learn and you will certainly 
benefit if you are not learning C as your first programming language! 
C is trendly many well established programmers are switching to C for 
all short of reasons, but mainly because of the portability that writing 
standard C programs can offer.
CODING 
/ 
* THIS SOFTWARE IS A DATABASE PROJECT WITH ALL THE BASIC CAPABILITIES 
A 
//////////////////////////////////////////////////////////////////////// 
DATABASE SHOULD HAVE. THIS APPLICATION SOFTWARE IS ABOUT AIRPORT 
RESERVATION 
/////////////////////////////////////////////////////////////////////////// 
AND IT RECORDS AND MAINTAINS RECORDS ABOUT THE AIRLINES AND THE 
CUSTOMER. 
/////////////////////////////////////////////////////////////////////////// 
RECORDS FOR AIRLINES AND CUSTOMERS ARE SAVED IN SEPERATE FILES AND 
CAN 
//////////////////////////////////////////////////////////////////////// 
BE USED TO DELETE OR MODIFY RECORDS IN THEM ........ 
*/ 
#include <graphics.h> 
#include <stdio.h> 
#include <conio.h> 
#include <dos.h> 
#include <stdlib.h> 
#include <string.h> 
struct record { // STRUCTURE FOR AIRLINE 
char name[30]; 
char type[15]; // WITH THEIR ELEMENTS 
char dday[10]; 
char dtime[10]; 
char aday[10]; 
char atime[10]; 
char des[30]; 
int capa; 
} airline; 
struct record1 { // STRUCTURE FOR CUSTOMERS
char name[20]; 
char addr[40]; 
char pnum[15]; 
char dob[15]; 
char nic[15]; 
char pass[15]; 
char nation[20]; // AND THEIR ELEMENTS 
char dest[30]; 
char airline[20]; 
char dod[10]; 
char time[10]; 
} customer; 
void printTitle(void); 
void showMenu(void); // FUNCTIONS 
void customerf(void); 
void airlinef(void); 
void start(void); 
void menu(void); // MADE AND USED 
void add_airline(void); 
void edit_airline(); 
void delete_airline(void); 
void add_customer(void); // IN THE PROGRAMS 
void edit_customer(void); 
void delete_customer(void); 
void end(void); 
void view_airline(void); 
void view_customer(void); 
void option(void); 
void option1(void); 
void end2(void); 
void option2(void); 
int Password(void); 
void inv(void); 
int c=0,d=0; 
void main(void) 
{ 
int Proceed; 
int driver=VGA,mode=VGAHI; //detect best driver and mode 
initgraph(&driver,&mode,"c:tcbgi"); //initialize graphics mode
randomize(); 
do 
{ 
Proceed = Password(); // CHECK THE PASSWORD 
} while ( Proceed!=1); 
cleardevice(); 
start(); // AND THEM CHECK 
menu(); 
getch(); // THE VALUE RETURNED... 
closegraph(); 
} 
void start(void) 
{ // FUNTION USED FOR MAKING THE 
setcolor(RED); 
setlinestyle(SOLID_LINE,1,3); 
rectangle(0,0,639,479); // RECTANGLE WHICH IS THE BORDER 
setcolor(BLUE); 
setlinestyle(SOLID_LINE,1,2); // ... COLORS ARE USED IN THEM.. 
rectangle(10,10,629,469); 
} 
void showMenu(void) 
{ 
settextstyle(TRIPLEX_FONT,HORIZ_DIR,4); //set text style for the 
options 
setcolor(WHITE); //set colour for the fonts 
outtextxy(60,150,"1) AIRLINE INFORMATION"); //setting the position and the 
font 
outtextxy(60,210,"2) CUSTOMER PROFILE"); //setting the position 
and the font 
outtextxy(60,270,"3) EXIT"); //setting the position and the font 
} 
void menu(void) 
{ 
settextstyle(TRIPLEX_FONT,HORIZ_DIR,4); //set text style for the 
options 
setcolor(WHITE); //set colour for the fonts 
outtextxy(60,150,"1) AIRLINE INFORMATION"); //setting the position and the 
font 
outtextxy(60,210,"2) CUSTOMER PROFILE"); //setting the position 
and the font 
outtextxy(60,270,"3) EXIT"); //setting the position and the font
while (1) //loop will folow untill key 
board hits 
{ 
while(!(kbhit())) 
{ 
printTitle(); 
} 
switch(getch()) // getting options from the 
user 
{ 
case '1': 
settextstyle(TRIPLEX_FONT,HORIZ_DIR,4); //set text style 
for the options 
setcolor(0); //set colour for the fonts 
outtextxy(60,150,"1) AIRLINE INFORMATION"); //setting the position 
and the font 
settextstyle(TRIPLEX_FONT,HORIZ_DIR,5); //set text style 
for the options 
setcolor(10); //set colour for the fonts 
outtextxy(60,150,"1) AIRLINE INFORMATION"); //setting the position 
and the font 
delay(500); 
airlinef(); 
cleardevice(); 
start(); 
showMenu(); 
break; 
case '2': 
settextstyle(TRIPLEX_FONT,HORIZ_DIR,4); //set text style 
for the options 
setcolor(0); //set colour for the fonts 
outtextxy(60,210,"2) CUSTOMER PROFILE"); //setting the position 
and the font 
settextstyle(TRIPLEX_FONT,HORIZ_DIR,5); //set text style 
for the options 
setcolor(10); //set colour for the fonts 
outtextxy(60,210,"2) CUSTOMER PROFILE"); //setting the position 
and the font 
delay(500); 
customerf(); 
cleardevice();
start(); 
showMenu(); 
break; 
case '3': 
settextstyle(TRIPLEX_FONT,HORIZ_DIR,4); //set text style 
for the options 
setcolor(0); //set colour for the fonts 
outtextxy(60,270,"3) EXIT"); //setting the position and the 
font 
settextstyle(TRIPLEX_FONT,HORIZ_DIR,5); //set text style 
for the options 
setcolor(10); //set colour for the fonts 
outtextxy(60,270,"3) EXIT"); //setting the position and the 
font 
delay(500); 
end(); 
cleardevice(); 
start(); 
showMenu(); // END FUNCTION IS CALLED 
AFTER 
break; 
default: 
inv(); 
} 
} 
} 
void printTitle(void) 
{ 
int temp, temp2; 
temp=(rand()% 15)+1; 
settextstyle(SANS_SERIF_FONT,HORIZ_DIR,4); //set tect style for the 
heading 
setcolor(temp); //set colour for the 
fonts 
outtextxy(16,40,"WELCOME TO THE AIRPORT RESERVATION"); 
//setting the position and the font 
temp2=(rand()%15)+1; 
setcolor(temp2); //set colour for the 
underline 
line(20,80,621,80); //set position for the line 
delay(400); //blinking the heading
} 
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(); 
menu(); 
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(); 
menu(); 
break; 
default : 
inv(); 
customerf(); 
} 
} 
void end (void) 
{ 
cleardevice(); 
settextstyle(TRIPLEX_FONT,HORIZ_DIR,3); 
setcolor(WHITE); 
outtextxy(60,150,"ARE YOU SURE YOU WANT TO EXIT (Y/N)"); 
switch(getch()) 
{ 
case 'Y': 
case 'y': 
end2(); 
exit(0); 
break; 
case 'N': 
case 'n': 
break; 
default : 
inv(); 
getch(); 
end(); 
} 
} 
void add_airline(void) 
{ 
FILE *fpoin; 
char temp[30];
int a=35; 
fpoin=fopen("c: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("c: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("ntDESTINATIONt %s  
ntAIRCRAFT TYPEt %s  
ntDEPARTURE DAYt %s  
ntDEPARTURE TIMEt %s  
ntARRIVAL DAYt %s  
ntARRIVAL TIMEt %s  
ntCAPACITYt 
%d",airline.des,airline.type,airline.dday,airline.dtime,airline.aday,airline.atime,airline.capa); 
printf("nnnnn"); 
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("c: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("c:airline.txt"); 
rename("c:temp.txt","c:airline.txt");
fpoin=fopen("c: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("c: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("ntDESTINATIONt %s  
ntAIRCRAFT TYPEt %s  
ntDEPARTURE DAYt %s  
ntDEPARTURE TIMEt %s  
ntARRIVAL DAYt %s
ntARRIVAL TIMEt %s  
ntCAPACITYt 
%d",airline.des,airline.type,airline.dday,airline.dtime,airline.aday,airline.atime,airline.capa); 
printf("nnnnn"); 
start(); 
count++; 
getch(); 
} 
} 
printf("nntttTHERE 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("c: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("ntDESTINATIONt %s
ntAIRCRAFT TYPEt %s  
ntDEPARTURE DAYt %s  
ntDEPARTURE TIMEt %s  
ntARRIVAL DAYt %s  
ntARRIVAL TIMEt %s  
ntCAPACITYt 
%d",airline.des,airline.type,airline.dday,airline.dtime,airline.aday,airline.atime,airline.capa); 
printf("nnnnn"); 
start(); 
count++; 
getch(); 
} 
} 
printf("nntttTHERE 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("c:airline.txt","r"); 
while((fread(&airline,sizeof(airline),1,fpoin))!=NULL) 
{ 
if((strcmp(searchname,airline.name)==0)&&(strcmp(desname,airline.des)==0)) 
{ 
cleardevice();
start(); 
gotoxy(9,10); 
printf("AIRLINE NAME"); 
gotoxy(26,10); 
puts(airline.name); 
gotoxy(20,11); 
printf("ntDESTINATIONt %s  
ntAIRCRAFT TYPEt %s  
ntDEPARTURE DAYt %s  
ntDEPARTURE TIMEt %s  
ntARRIVAL DAYt %s  
ntARRIVAL TIMEt %s  
ntCAPACITYt 
%d",airline.des,airline.type,airline.dday,airline.dtime,airline.aday,airline.atime,airline.capa); 
printf("nnnnn"); 
start(); 
count++; 
getch(); 
} 
} 
printf("nntttTHERE 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("c: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("ntDESTINATIONt %s  
ntAIRCRAFT TYPEt %s  
ntDEPARTURE DAYt %s  
ntDEPARTURE TIMEt %s  
ntARRIVAL DAYt %s  
ntARRIVAL TIMEt %s  
ntCAPACITYt 
%d",airline.des,airline.type,airline.dday,airline.dtime,airline.aday,airline.atime,airline.capa); 
printf("nnnnn"); 
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("c: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("c:airline.txt"); 
rename("c:temp.txt","d:airline.txt"); 
fpoin=fopen("d: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("d: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("c: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("ntADDRESSttt %s  
ntPHONE NUMBERtt %s  
ntDATE OF BIRTHtt %s  
ntNIC NUMBERtt %s  
ntPASSPORT NUMBERtt %s  
ntNATIONALITYtt %s  
ntDESTINATIONtt %s  
ntAIRLINEttt %s  
ntDAY OF DEPARTUREt %s  
ntTIME OF DEPARTUREt 
%s",customer.addr,customer.pnum,customer.dob,customer.nic,customer.pass,customer.nation,cu 
stomer.dest,customer.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("c: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("d:customer.txt"); 
rename("d:temp.txt","d:customer.txt"); 
fpoin1=fopen("d: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("c: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("ntADDRESSttt %s  
ntPHONE NUMBERtt %s  
ntDATE OF BIRTHtt %s  
ntNIC NUMBERtt %s  
ntPASSPORT NUMBERtt %s  
ntNATIONALITYtt %s  
ntDESTINATIONtt %s  
ntAIRLINEttt %s  
ntDAY OF DEPARTUREt %s  
ntTIME OF DEPARTUREt 
%s",customer.addr,customer.pnum,customer.dob,customer.nic,customer.pass,customer.nation,cu 
stomer.dest,customer.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("c: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("c:customer.txt"); 
rename("c:temp.txt","c:customer.txt"); 
fpoin1=fopen("d: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("c: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("ntADDRESSttt %s  
ntPHONE NUMBERtt %s  
ntDATE OF BIRTHtt %s  
ntNIC NUMBERtt %s  
ntPASSPORT NUMBERtt %s  
ntNATIONALITYtt %s  
ntDESTINATIONtt %s  
ntAIRLINEttt %s  
ntDAY OF DEPARTUREt %s  
ntTIME OF DEPARTUREt 
%s",customer.addr,customer.pnum,customer.dob,customer.nic,customer.pass,customer.nation,cu 
stomer.dest,customer.airline,customer.dod,customer.time); 
printf("nnnn"); 
start(); 
count++; 
getch(); 
} 
} 
printf("ntttTHERE ARE %d RECORD(S)",count); 
start(); 
getch();
} 
void end2(void) 
{ 
int driver=DETECT,mode; //detect best driver and mode 
int i,j=520; 
initgraph(&driver,&mode,"c:tcbgi"); //initialize graphics mode 
for(i=480;i>=0;i--) 
{ 
setcolor(WHITE); 
outtextxy(230,i,"DESIGNED BY"); 
outtextxy(195,j,"FAHAD BIN NADEEM MIR"); 
/* outtextxy(219,j+15,"RAHEEL YASEEN"); 
outtextxy(192,j+30,"LIBERETA ADELE DSOUZA"); 
outtextxy(216,j+45,"SHARMEEN KHEMANI"); 
outtextxy(225,j+60,"ZAHRA KHIMANI"); 
outtextxy(230,j+75,"ASMA ABBAS"); */ 
outtextxy(243,j+120,"BCS 1-C"); 
outtextxy(243,j+140,"SZABIST"); 
outtextxy(243,j+160,"KARACHI"); 
delay(20); 
j--; 
cleardevice(); 
} closegraph(); 
} 
int Password (void) 
{ 
char Password[12]="yogeeta"; // Already assigned password 
char pass[20]; 
char UserName[15]; 
char user[15]="fahad"; 
int sucess=0; // Password Verification 
int x=26,i; 
cleardevice(); 
line ( 130, 180, 500, 180 ); // creates.. 
rectangle ( 130, 150, 500, 300 ); 
setfillstyle ( SOLID_FILL, 7 ); // ..the dialouge box.. 
bar ( 130, 150, 500, 180 );
setfillstyle ( SOLID_FILL, 8 ); // ..where password and user name.. 
bar ( 130, 180, 500, 300 ); 
setcolor ( 4 ); // ..can be entered 
outtextxy ( 140, 165, " P A S S W O R D V E R I F I C A T I O N " ); 
setfillstyle ( SOLID_FILL, 0 ); 
bar ( 200, 200, 450, 230 ); 
bar ( 200, 247, 450, 277 ); 
outtextxy ( 130, 210, " NAME " ); 
outtextxy ( 126, 258, " PASSWORD " ); 
gotoxy(26,14); 
gets(UserName); 
for(i=0;i<20;i++ ) // Gets the password.. 
{ 
pass[i]=getch(); // ..until enter key is not pressed.. 
if(pass[i]=='r') 
{ 
pass[i]='0'; // Enter a NULL character 
break; 
} 
else 
{ 
gotoxy(x,17);printf("*"); // ..and prints asterix on the screen 
x++; 
} 
} 
if ((strcmp(Password,pass)==0)&&(strcmp(UserName,user)==0)) // checks password 
character.. 
sucess=1; 
else // If incorrect password 
{ 
sucess=0; 
gotoxy (22, 21); 
printf ( " INVALID PASSWORD! TRY AGAIN " ); 
getche (); 
} 
return ( sucess ); 
} 
void inv(void) 
{
sound(700); 
outtextxy(300,430,"INVALID INPUT"); 
delay(500); 
nosound(); 
setcolor(0); 
outtextxy(300,430,"INVALID INPUT"); 
}
REQUIRED SOURCES 
BASIC KNOWLEDGE OF C LANGUAGE 
Including 
Arrays , 
structure, 
pointers, 
functions, 
looping 
Help from Internet for the pure programming in C language 
Books consisting of 
pure programming, 
security systems, 
working of mouse and keyboard in c in windows 
Laboratory Facility for the execution of programme 
Teacher Guidance for programming algorithm to develop the program in 
right way and sence with proper steps and measures.
REFRENCES 
Programming in ANSI & TURBO ‘C’ by Ashok 
N Kamthane 
Let Us C by Yashwant Kanitkar 
Programming in C by E.Balaguruswami 
www.planet.sourcecode.com 
www.books.google.com 
www.knowledgestorm.com
Ad

More Related Content

Viewers also liked (7)

How to design for children planningness 2013
How to design for children  planningness 2013How to design for children  planningness 2013
How to design for children planningness 2013
MeganDickerson
 
Nintendo
NintendoNintendo
Nintendo
momoore44
 
The vif experience
The vif experienceThe vif experience
The vif experience
MeganDickerson
 
Kuliah rc2013
Kuliah rc2013Kuliah rc2013
Kuliah rc2013
Sbh Iptb
 
Data flow diagram for order system
Data flow diagram for order systemData flow diagram for order system
Data flow diagram for order system
Upendra Sengar
 
Keselamatan Bengkel KH
Keselamatan Bengkel KHKeselamatan Bengkel KH
Keselamatan Bengkel KH
Sbh Iptb
 
Telephone directory
Telephone directoryTelephone directory
Telephone directory
Upendra Sengar
 
How to design for children planningness 2013
How to design for children  planningness 2013How to design for children  planningness 2013
How to design for children planningness 2013
MeganDickerson
 
Kuliah rc2013
Kuliah rc2013Kuliah rc2013
Kuliah rc2013
Sbh Iptb
 
Data flow diagram for order system
Data flow diagram for order systemData flow diagram for order system
Data flow diagram for order system
Upendra Sengar
 
Keselamatan Bengkel KH
Keselamatan Bengkel KHKeselamatan Bengkel KH
Keselamatan Bengkel KH
Sbh Iptb
 

Similar to Ticket window & automation system (20)

C Language ppt create by Anand & Sager.pptx
C Language ppt create by Anand & Sager.pptxC Language ppt create by Anand & Sager.pptx
C Language ppt create by Anand & Sager.pptx
kumaranand07297
 
C language by Dr. D. R. Gholkar
C language by Dr. D. R. GholkarC language by Dr. D. R. Gholkar
C language by Dr. D. R. Gholkar
PRAVIN GHOLKAR
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
Commit University
 
My programming final proj. (1)
My programming final proj. (1)My programming final proj. (1)
My programming final proj. (1)
aeden_brines
 
Student Lab Activity CIS170 Week 6 Lab Instructions.docx
Student Lab Activity CIS170 Week 6 Lab Instructions.docxStudent Lab Activity CIS170 Week 6 Lab Instructions.docx
Student Lab Activity CIS170 Week 6 Lab Instructions.docx
florriezhamphrey3065
 
C prog ppt
C prog pptC prog ppt
C prog ppt
xinoe
 
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdf
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdfModule 1_Chapter 2_PPT (1)sasaddsdsds.pdf
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdf
anilcsbs
 
C++ basics
C++ basicsC++ basics
C++ basics
AllsoftSolutions
 
SQL- Introduction to PL/SQL
SQL- Introduction to  PL/SQLSQL- Introduction to  PL/SQL
SQL- Introduction to PL/SQL
Vibrant Technologies & Computers
 
Cis 170 c ilab 7 of 7 sequential files
Cis 170 c ilab 7 of 7 sequential filesCis 170 c ilab 7 of 7 sequential files
Cis 170 c ilab 7 of 7 sequential files
CIS321
 
Unit3 overview of_c_programming
Unit3 overview of_c_programmingUnit3 overview of_c_programming
Unit3 overview of_c_programming
Capuchino HuiNing
 
3- In the program figurespointers we have a base class location and va.pdf
3- In the program figurespointers we have a base class location and va.pdf3- In the program figurespointers we have a base class location and va.pdf
3- In the program figurespointers we have a base class location and va.pdf
atozshoppe
 
Overview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiOverview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya Jyothi
Sowmya Jyothi
 
1 2 programming
1 2 programming1 2 programming
1 2 programming
azimuthal
 
C language updated
C language updatedC language updated
C language updated
Arafat Bin Reza
 
Plsql
PlsqlPlsql
Plsql
fika sweety
 
System programmin practical file
System programmin practical fileSystem programmin practical file
System programmin practical file
Ankit Dixit
 
1_Introduction of programming language C.pptx
1_Introduction of programming language C.pptx1_Introduction of programming language C.pptx
1_Introduction of programming language C.pptx
b221382
 
Basics1
Basics1Basics1
Basics1
phanleson
 
Srgoc dotnet_new
Srgoc dotnet_newSrgoc dotnet_new
Srgoc dotnet_new
Gaurav Singh
 
C Language ppt create by Anand & Sager.pptx
C Language ppt create by Anand & Sager.pptxC Language ppt create by Anand & Sager.pptx
C Language ppt create by Anand & Sager.pptx
kumaranand07297
 
C language by Dr. D. R. Gholkar
C language by Dr. D. R. GholkarC language by Dr. D. R. Gholkar
C language by Dr. D. R. Gholkar
PRAVIN GHOLKAR
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
Commit University
 
My programming final proj. (1)
My programming final proj. (1)My programming final proj. (1)
My programming final proj. (1)
aeden_brines
 
Student Lab Activity CIS170 Week 6 Lab Instructions.docx
Student Lab Activity CIS170 Week 6 Lab Instructions.docxStudent Lab Activity CIS170 Week 6 Lab Instructions.docx
Student Lab Activity CIS170 Week 6 Lab Instructions.docx
florriezhamphrey3065
 
C prog ppt
C prog pptC prog ppt
C prog ppt
xinoe
 
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdf
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdfModule 1_Chapter 2_PPT (1)sasaddsdsds.pdf
Module 1_Chapter 2_PPT (1)sasaddsdsds.pdf
anilcsbs
 
Cis 170 c ilab 7 of 7 sequential files
Cis 170 c ilab 7 of 7 sequential filesCis 170 c ilab 7 of 7 sequential files
Cis 170 c ilab 7 of 7 sequential files
CIS321
 
Unit3 overview of_c_programming
Unit3 overview of_c_programmingUnit3 overview of_c_programming
Unit3 overview of_c_programming
Capuchino HuiNing
 
3- In the program figurespointers we have a base class location and va.pdf
3- In the program figurespointers we have a base class location and va.pdf3- In the program figurespointers we have a base class location and va.pdf
3- In the program figurespointers we have a base class location and va.pdf
atozshoppe
 
Overview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya JyothiOverview of C Mrs Sowmya Jyothi
Overview of C Mrs Sowmya Jyothi
Sowmya Jyothi
 
1 2 programming
1 2 programming1 2 programming
1 2 programming
azimuthal
 
System programmin practical file
System programmin practical fileSystem programmin practical file
System programmin practical file
Ankit Dixit
 
1_Introduction of programming language C.pptx
1_Introduction of programming language C.pptx1_Introduction of programming language C.pptx
1_Introduction of programming language C.pptx
b221382
 
Ad

More from Upendra Sengar (16)

Shipping and Storage: A New Approach
Shipping and Storage: A New ApproachShipping and Storage: A New Approach
Shipping and Storage: A New Approach
Upendra Sengar
 
Sales and inventory management project report
Sales and inventory management project reportSales and inventory management project report
Sales and inventory management project report
Upendra Sengar
 
Data flow diagram
Data flow diagramData flow diagram
Data flow diagram
Upendra Sengar
 
Medical store management system
Medical store management systemMedical store management system
Medical store management system
Upendra Sengar
 
Photo-Elctric Effect
Photo-Elctric EffectPhoto-Elctric Effect
Photo-Elctric Effect
Upendra Sengar
 
Ums in c
Ums in cUms in c
Ums in c
Upendra Sengar
 
Tictac
TictacTictac
Tictac
Upendra Sengar
 
Tic tac toe
Tic tac toeTic tac toe
Tic tac toe
Upendra Sengar
 
Term paper of cse(211) avdhesh sharma c1801 a24 regd 10802037
Term paper of cse(211) avdhesh sharma c1801 a24 regd 10802037Term paper of cse(211) avdhesh sharma c1801 a24 regd 10802037
Term paper of cse(211) avdhesh sharma c1801 a24 regd 10802037
Upendra Sengar
 
Student record
Student recordStudent record
Student record
Upendra Sengar
 
Snake game implementation in c
Snake game implementation in cSnake game implementation in c
Snake game implementation in c
Upendra Sengar
 
Scientific calculator in c
Scientific calculator in cScientific calculator in c
Scientific calculator in c
Upendra Sengar
 
Tic tac toe game code
Tic tac toe game codeTic tac toe game code
Tic tac toe game code
Upendra Sengar
 
Telephone directory in c
Telephone directory in cTelephone directory in c
Telephone directory in c
Upendra Sengar
 
Book store automation system
Book store automation systemBook store automation system
Book store automation system
Upendra Sengar
 
Bluetooth technology
Bluetooth technologyBluetooth technology
Bluetooth technology
Upendra Sengar
 
Shipping and Storage: A New Approach
Shipping and Storage: A New ApproachShipping and Storage: A New Approach
Shipping and Storage: A New Approach
Upendra Sengar
 
Sales and inventory management project report
Sales and inventory management project reportSales and inventory management project report
Sales and inventory management project report
Upendra Sengar
 
Medical store management system
Medical store management systemMedical store management system
Medical store management system
Upendra Sengar
 
Term paper of cse(211) avdhesh sharma c1801 a24 regd 10802037
Term paper of cse(211) avdhesh sharma c1801 a24 regd 10802037Term paper of cse(211) avdhesh sharma c1801 a24 regd 10802037
Term paper of cse(211) avdhesh sharma c1801 a24 regd 10802037
Upendra Sengar
 
Snake game implementation in c
Snake game implementation in cSnake game implementation in c
Snake game implementation in c
Upendra Sengar
 
Scientific calculator in c
Scientific calculator in cScientific calculator in c
Scientific calculator in c
Upendra Sengar
 
Telephone directory in c
Telephone directory in cTelephone directory in c
Telephone directory in c
Upendra Sengar
 
Book store automation system
Book store automation systemBook store automation system
Book store automation system
Upendra Sengar
 
Ad

Recently uploaded (20)

LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and GuestsLDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDM Mia eStudios
 
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living WorkshopLDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDM Mia eStudios
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
Celine George
 
All About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdfAll About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdf
TechSoup
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
Nguyen Thanh Tu Collection
 
Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...
parmarjuli1412
 
Form View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo SlidesForm View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo Slides
Celine George
 
spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)
Mohamed Rizk Khodair
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
Final Evaluation.docx...........................
Final Evaluation.docx...........................Final Evaluation.docx...........................
Final Evaluation.docx...........................
l1bbyburrell
 
*"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"**"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"*
Arshad Shaikh
 
Botany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic ExcellenceBotany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic Excellence
online college homework help
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
Overview Well-Being and Creative Careers
Overview Well-Being and Creative CareersOverview Well-Being and Creative Careers
Overview Well-Being and Creative Careers
University of Amsterdam
 
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptxANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
Mayuri Chavan
 
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
parmarjuli1412
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
puzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tensepuzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tense
OlgaLeonorTorresSnch
 
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and GuestsLDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDM Mia eStudios
 
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living WorkshopLDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDM Mia eStudios
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
Celine George
 
All About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdfAll About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdf
TechSoup
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
Nguyen Thanh Tu Collection
 
Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...
parmarjuli1412
 
Form View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo SlidesForm View Attributes in Odoo 18 - Odoo Slides
Form View Attributes in Odoo 18 - Odoo Slides
Celine George
 
spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)
Mohamed Rizk Khodair
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
Final Evaluation.docx...........................
Final Evaluation.docx...........................Final Evaluation.docx...........................
Final Evaluation.docx...........................
l1bbyburrell
 
*"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"**"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"*
Arshad Shaikh
 
Botany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic ExcellenceBotany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic Excellence
online college homework help
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
Overview Well-Being and Creative Careers
Overview Well-Being and Creative CareersOverview Well-Being and Creative Careers
Overview Well-Being and Creative Careers
University of Amsterdam
 
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptxANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
ANTI-VIRAL DRUGS unit 3 Pharmacology 3.pptx
Mayuri Chavan
 
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
parmarjuli1412
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
puzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tensepuzzle Irregular Verbs- Simple Past Tense
puzzle Irregular Verbs- Simple Past Tense
OlgaLeonorTorresSnch
 

Ticket window & automation system

  • 1. TERM PAPER ON “TICKET WINDOW AND AUTOMATION SYSTEM” FOR FOUNDATION OF COMPUTING (CSE 101) SUBMITTED TO: SUBMITTED BY: MISS SUKHDILPREET KAUR UTKARSH SINGH R246B33 B.TECH(CSE)-MBA
  • 2. Acknowledgement I am very thankful and expressing my deep sense of gratitude towards Miss Sukhdilpreet Kaur, Lecturer LSE, Lovely Professional University, who inspired me to work on this topic. I benefited a lot with discussing him on this topic. I am also thankful to my parents who provided me such a opportunity, for their inspiring words. I am also thankful to all my colleagues and all those who helped me in completion of this project. UTKARSH SINGH R246B33 B.TECH(CSE)-MBA
  • 3. TABLE OF CONTENTS 1. INTRODUCTION TO C 2. SOURCE CODE 3. REQUIRED SOURCES 4. REFRENCES
  • 4. INTRODUCTION OF C As a programming language, C is rather like Pascal or FORTRAN. Values are sorted in variables. Programs structured by defining and calling functions. Program flow is controlled using loops, if statement and function calls. Input and output can be directed to the terminal or to the file .Related data can be sorted together in array or structures.Of the three languages, C allows the most precise control of input and output .C is also rather more terse than FORTRAN and PASCAL .this can result in short efficient programs where the programmer has made wise use of C range of powerful operators. It also allows the programmer to produce which are impossible to understand. Programmer who are familiar with the use of pointers (or indirect addressing, to use the correct term) will welcome the ease of use compared with some other languages .Undisciplined use of pointer can lead to errors which are very hard to trace .This course only deals with the simplest applications of pointers.
  • 5. It is that newcomer will find C a useful and friendly language. Care must be taken in using C. many of the extra facilities which it offers can lead to extra types of programming error. You will have to learn to deal with these to successfully make the transition to being a C programmer. Why use C? C has been used successfully for every type of programming problem imaginable from operating systems to spreadsheets to expert system – and efficient compilers are available for machines ranging in power from the Apple Mocintosh to cray supercomputer. C is often called a “Middle Level” language. Use of C C was initially used for system development work, in particular the programs that make up operating system. Why use C? Mainly because it produces code written in assembly language. Some examples of the use of C might be: Operating system Language Compilers Assemblers
  • 6. Text Editors Modern Programs Language Interpreters In recent year C has been use a general-purpose language because of it is not the world’s easiest language to learn and you will certainly benefit if you are not learning C as your first programming language! C is trendly many well established programmers are switching to C for all short of reasons, but mainly because of the portability that writing standard C programs can offer.
  • 7. CODING / * THIS SOFTWARE IS A DATABASE PROJECT WITH ALL THE BASIC CAPABILITIES A //////////////////////////////////////////////////////////////////////// DATABASE SHOULD HAVE. THIS APPLICATION SOFTWARE IS ABOUT AIRPORT RESERVATION /////////////////////////////////////////////////////////////////////////// AND IT RECORDS AND MAINTAINS RECORDS ABOUT THE AIRLINES AND THE CUSTOMER. /////////////////////////////////////////////////////////////////////////// RECORDS FOR AIRLINES AND CUSTOMERS ARE SAVED IN SEPERATE FILES AND CAN //////////////////////////////////////////////////////////////////////// BE USED TO DELETE OR MODIFY RECORDS IN THEM ........ */ #include <graphics.h> #include <stdio.h> #include <conio.h> #include <dos.h> #include <stdlib.h> #include <string.h> struct record { // STRUCTURE FOR AIRLINE char name[30]; char type[15]; // WITH THEIR ELEMENTS char dday[10]; char dtime[10]; char aday[10]; char atime[10]; char des[30]; int capa; } airline; struct record1 { // STRUCTURE FOR CUSTOMERS
  • 8. char name[20]; char addr[40]; char pnum[15]; char dob[15]; char nic[15]; char pass[15]; char nation[20]; // AND THEIR ELEMENTS char dest[30]; char airline[20]; char dod[10]; char time[10]; } customer; void printTitle(void); void showMenu(void); // FUNCTIONS void customerf(void); void airlinef(void); void start(void); void menu(void); // MADE AND USED void add_airline(void); void edit_airline(); void delete_airline(void); void add_customer(void); // IN THE PROGRAMS void edit_customer(void); void delete_customer(void); void end(void); void view_airline(void); void view_customer(void); void option(void); void option1(void); void end2(void); void option2(void); int Password(void); void inv(void); int c=0,d=0; void main(void) { int Proceed; int driver=VGA,mode=VGAHI; //detect best driver and mode initgraph(&driver,&mode,"c:tcbgi"); //initialize graphics mode
  • 9. randomize(); do { Proceed = Password(); // CHECK THE PASSWORD } while ( Proceed!=1); cleardevice(); start(); // AND THEM CHECK menu(); getch(); // THE VALUE RETURNED... closegraph(); } void start(void) { // FUNTION USED FOR MAKING THE setcolor(RED); setlinestyle(SOLID_LINE,1,3); rectangle(0,0,639,479); // RECTANGLE WHICH IS THE BORDER setcolor(BLUE); setlinestyle(SOLID_LINE,1,2); // ... COLORS ARE USED IN THEM.. rectangle(10,10,629,469); } void showMenu(void) { settextstyle(TRIPLEX_FONT,HORIZ_DIR,4); //set text style for the options setcolor(WHITE); //set colour for the fonts outtextxy(60,150,"1) AIRLINE INFORMATION"); //setting the position and the font outtextxy(60,210,"2) CUSTOMER PROFILE"); //setting the position and the font outtextxy(60,270,"3) EXIT"); //setting the position and the font } void menu(void) { settextstyle(TRIPLEX_FONT,HORIZ_DIR,4); //set text style for the options setcolor(WHITE); //set colour for the fonts outtextxy(60,150,"1) AIRLINE INFORMATION"); //setting the position and the font outtextxy(60,210,"2) CUSTOMER PROFILE"); //setting the position and the font outtextxy(60,270,"3) EXIT"); //setting the position and the font
  • 10. while (1) //loop will folow untill key board hits { while(!(kbhit())) { printTitle(); } switch(getch()) // getting options from the user { case '1': settextstyle(TRIPLEX_FONT,HORIZ_DIR,4); //set text style for the options setcolor(0); //set colour for the fonts outtextxy(60,150,"1) AIRLINE INFORMATION"); //setting the position and the font settextstyle(TRIPLEX_FONT,HORIZ_DIR,5); //set text style for the options setcolor(10); //set colour for the fonts outtextxy(60,150,"1) AIRLINE INFORMATION"); //setting the position and the font delay(500); airlinef(); cleardevice(); start(); showMenu(); break; case '2': settextstyle(TRIPLEX_FONT,HORIZ_DIR,4); //set text style for the options setcolor(0); //set colour for the fonts outtextxy(60,210,"2) CUSTOMER PROFILE"); //setting the position and the font settextstyle(TRIPLEX_FONT,HORIZ_DIR,5); //set text style for the options setcolor(10); //set colour for the fonts outtextxy(60,210,"2) CUSTOMER PROFILE"); //setting the position and the font delay(500); customerf(); cleardevice();
  • 11. start(); showMenu(); break; case '3': settextstyle(TRIPLEX_FONT,HORIZ_DIR,4); //set text style for the options setcolor(0); //set colour for the fonts outtextxy(60,270,"3) EXIT"); //setting the position and the font settextstyle(TRIPLEX_FONT,HORIZ_DIR,5); //set text style for the options setcolor(10); //set colour for the fonts outtextxy(60,270,"3) EXIT"); //setting the position and the font delay(500); end(); cleardevice(); start(); showMenu(); // END FUNCTION IS CALLED AFTER break; default: inv(); } } } void printTitle(void) { int temp, temp2; temp=(rand()% 15)+1; settextstyle(SANS_SERIF_FONT,HORIZ_DIR,4); //set tect style for the heading setcolor(temp); //set colour for the fonts outtextxy(16,40,"WELCOME TO THE AIRPORT RESERVATION"); //setting the position and the font temp2=(rand()%15)+1; setcolor(temp2); //set colour for the underline line(20,80,621,80); //set position for the line delay(400); //blinking the heading
  • 12. } 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':
  • 13. cleardevice(); start(); menu(); 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;
  • 14. case '4': edit_customer(); cleardevice(); customerf(); break; case '5': cleardevice(); start(); menu(); break; default : inv(); customerf(); } } void end (void) { cleardevice(); settextstyle(TRIPLEX_FONT,HORIZ_DIR,3); setcolor(WHITE); outtextxy(60,150,"ARE YOU SURE YOU WANT TO EXIT (Y/N)"); switch(getch()) { case 'Y': case 'y': end2(); exit(0); break; case 'N': case 'n': break; default : inv(); getch(); end(); } } void add_airline(void) { FILE *fpoin; char temp[30];
  • 15. int a=35; fpoin=fopen("c: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));
  • 16. 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("c:airline.txt","r"); while((fread(&airline,sizeof(airline),1,fpoin))!=NULL) { count1++; if((strcmp(searchname,airline.name)==0)&&(strcmp(desname,airline.des)==0))
  • 17. { success2=1; cleardevice(); start(); gotoxy(9,10); printf("AIRLINE NAME"); gotoxy(26,10); puts(airline.name); gotoxy(20,11); printf("ntDESTINATIONt %s ntAIRCRAFT TYPEt %s ntDEPARTURE DAYt %s ntDEPARTURE TIMEt %s ntARRIVAL DAYt %s ntARRIVAL TIMEt %s ntCAPACITYt %d",airline.des,airline.type,airline.dday,airline.dtime,airline.aday,airline.atime,airline.capa); printf("nnnnn"); 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; } }
  • 18. if((success2==1)&&(success==1)) { rewind(fpoin); fpoin1=fopen("c: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("c:airline.txt"); rename("c:temp.txt","c:airline.txt");
  • 19. fpoin=fopen("c: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();
  • 20. 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("c: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("ntDESTINATIONt %s ntAIRCRAFT TYPEt %s ntDEPARTURE DAYt %s ntDEPARTURE TIMEt %s ntARRIVAL DAYt %s
  • 21. ntARRIVAL TIMEt %s ntCAPACITYt %d",airline.des,airline.type,airline.dday,airline.dtime,airline.aday,airline.atime,airline.capa); printf("nnnnn"); start(); count++; getch(); } } printf("nntttTHERE 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("c: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("ntDESTINATIONt %s
  • 22. ntAIRCRAFT TYPEt %s ntDEPARTURE DAYt %s ntDEPARTURE TIMEt %s ntARRIVAL DAYt %s ntARRIVAL TIMEt %s ntCAPACITYt %d",airline.des,airline.type,airline.dday,airline.dtime,airline.aday,airline.atime,airline.capa); printf("nnnnn"); start(); count++; getch(); } } printf("nntttTHERE 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("c:airline.txt","r"); while((fread(&airline,sizeof(airline),1,fpoin))!=NULL) { if((strcmp(searchname,airline.name)==0)&&(strcmp(desname,airline.des)==0)) { cleardevice();
  • 23. start(); gotoxy(9,10); printf("AIRLINE NAME"); gotoxy(26,10); puts(airline.name); gotoxy(20,11); printf("ntDESTINATIONt %s ntAIRCRAFT TYPEt %s ntDEPARTURE DAYt %s ntDEPARTURE TIMEt %s ntARRIVAL DAYt %s ntARRIVAL TIMEt %s ntCAPACITYt %d",airline.des,airline.type,airline.dday,airline.dtime,airline.aday,airline.atime,airline.capa); printf("nnnnn"); start(); count++; getch(); } } printf("nntttTHERE 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:");
  • 24. gets(temp); desname=strupr(temp); fpoin=fopen("c: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("ntDESTINATIONt %s ntAIRCRAFT TYPEt %s ntDEPARTURE DAYt %s ntDEPARTURE TIMEt %s ntARRIVAL DAYt %s ntARRIVAL TIMEt %s ntCAPACITYt %d",airline.des,airline.type,airline.dday,airline.dtime,airline.aday,airline.atime,airline.capa); printf("nnnnn"); 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(); }
  • 25. if(success==1) break; } } if((success2==1)&&(success==1)) { rewind(fpoin); fpoin1=fopen("c: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);
  • 26. while((fread(&airline,sizeof(airline),1,fpoin))!=NULL) fwrite(&airline, sizeof(airline),1,fpoin1); start(); fclose(fpoin1); fclose(fpoin); remove("c:airline.txt"); rename("c:temp.txt","d:airline.txt"); fpoin=fopen("d: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("d:customer.txt","a"); cleardevice(); start(); settextstyle(DEFAULT_FONT,HORIZ_DIR,3); outtextxy(35,40,"ADD CUSTOMER INFORMATION");
  • 27. 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);
  • 28. 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("c:customer.txt","r"); while((fread(&customer,sizeof(customer),1,fpoin1))!=NULL) {
  • 29. 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("ntADDRESSttt %s ntPHONE NUMBERtt %s ntDATE OF BIRTHtt %s ntNIC NUMBERtt %s ntPASSPORT NUMBERtt %s ntNATIONALITYtt %s ntDESTINATIONtt %s ntAIRLINEttt %s ntDAY OF DEPARTUREt %s ntTIME OF DEPARTUREt %s",customer.addr,customer.pnum,customer.dob,customer.nic,customer.pass,customer.nation,cu stomer.dest,customer.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(); }
  • 30. if(success==1) break; } } if((success2==1)&&(success==1)) { i=1; rewind(fpoin1); fpoin2=fopen("c: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); }
  • 31. start(); cleardevice(); start(); setcolor(RED); outtextxy(100,170,"RECORD MODIFIED"); delay(1500); fclose(fpoin2); fclose(fpoin1); remove("d:customer.txt"); rename("d:temp.txt","d:customer.txt"); fpoin1=fopen("d: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();
  • 32. gotoxy(10,5); printf("ENTER THE NAME OF CUSTOMER:"); gets(temp); searchname=strupr(temp); gotoxy(10,7); fpoin1=fopen("c: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("ntADDRESSttt %s ntPHONE NUMBERtt %s ntDATE OF BIRTHtt %s ntNIC NUMBERtt %s ntPASSPORT NUMBERtt %s ntNATIONALITYtt %s ntDESTINATIONtt %s ntAIRLINEttt %s ntDAY OF DEPARTUREt %s ntTIME OF DEPARTUREt %s",customer.addr,customer.pnum,customer.dob,customer.nic,customer.pass,customer.nation,cu stomer.dest,customer.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;
  • 33. case 'F': case 'f': break; default : success=2; inv(); } if(success==1) break; } } if((success2==1)&&(success==1)) { i=1; rewind(fpoin1); fpoin2=fopen("c: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);
  • 34. 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("c:customer.txt"); rename("c:temp.txt","c:customer.txt"); fpoin1=fopen("d: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;
  • 35. cleardevice(); start(); gotoxy(10,5); printf("Enter the name of customer to search:"); gets(temp); searchname=strupr(temp); fpoin1=fopen("c: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("ntADDRESSttt %s ntPHONE NUMBERtt %s ntDATE OF BIRTHtt %s ntNIC NUMBERtt %s ntPASSPORT NUMBERtt %s ntNATIONALITYtt %s ntDESTINATIONtt %s ntAIRLINEttt %s ntDAY OF DEPARTUREt %s ntTIME OF DEPARTUREt %s",customer.addr,customer.pnum,customer.dob,customer.nic,customer.pass,customer.nation,cu stomer.dest,customer.airline,customer.dod,customer.time); printf("nnnn"); start(); count++; getch(); } } printf("ntttTHERE ARE %d RECORD(S)",count); start(); getch();
  • 36. } void end2(void) { int driver=DETECT,mode; //detect best driver and mode int i,j=520; initgraph(&driver,&mode,"c:tcbgi"); //initialize graphics mode for(i=480;i>=0;i--) { setcolor(WHITE); outtextxy(230,i,"DESIGNED BY"); outtextxy(195,j,"FAHAD BIN NADEEM MIR"); /* outtextxy(219,j+15,"RAHEEL YASEEN"); outtextxy(192,j+30,"LIBERETA ADELE DSOUZA"); outtextxy(216,j+45,"SHARMEEN KHEMANI"); outtextxy(225,j+60,"ZAHRA KHIMANI"); outtextxy(230,j+75,"ASMA ABBAS"); */ outtextxy(243,j+120,"BCS 1-C"); outtextxy(243,j+140,"SZABIST"); outtextxy(243,j+160,"KARACHI"); delay(20); j--; cleardevice(); } closegraph(); } int Password (void) { char Password[12]="yogeeta"; // Already assigned password char pass[20]; char UserName[15]; char user[15]="fahad"; int sucess=0; // Password Verification int x=26,i; cleardevice(); line ( 130, 180, 500, 180 ); // creates.. rectangle ( 130, 150, 500, 300 ); setfillstyle ( SOLID_FILL, 7 ); // ..the dialouge box.. bar ( 130, 150, 500, 180 );
  • 37. setfillstyle ( SOLID_FILL, 8 ); // ..where password and user name.. bar ( 130, 180, 500, 300 ); setcolor ( 4 ); // ..can be entered outtextxy ( 140, 165, " P A S S W O R D V E R I F I C A T I O N " ); setfillstyle ( SOLID_FILL, 0 ); bar ( 200, 200, 450, 230 ); bar ( 200, 247, 450, 277 ); outtextxy ( 130, 210, " NAME " ); outtextxy ( 126, 258, " PASSWORD " ); gotoxy(26,14); gets(UserName); for(i=0;i<20;i++ ) // Gets the password.. { pass[i]=getch(); // ..until enter key is not pressed.. if(pass[i]=='r') { pass[i]='0'; // Enter a NULL character break; } else { gotoxy(x,17);printf("*"); // ..and prints asterix on the screen x++; } } if ((strcmp(Password,pass)==0)&&(strcmp(UserName,user)==0)) // checks password character.. sucess=1; else // If incorrect password { sucess=0; gotoxy (22, 21); printf ( " INVALID PASSWORD! TRY AGAIN " ); getche (); } return ( sucess ); } void inv(void) {
  • 38. sound(700); outtextxy(300,430,"INVALID INPUT"); delay(500); nosound(); setcolor(0); outtextxy(300,430,"INVALID INPUT"); }
  • 39. REQUIRED SOURCES BASIC KNOWLEDGE OF C LANGUAGE Including Arrays , structure, pointers, functions, looping Help from Internet for the pure programming in C language Books consisting of pure programming, security systems, working of mouse and keyboard in c in windows Laboratory Facility for the execution of programme Teacher Guidance for programming algorithm to develop the program in right way and sence with proper steps and measures.
  • 40. REFRENCES Programming in ANSI & TURBO ‘C’ by Ashok N Kamthane Let Us C by Yashwant Kanitkar Programming in C by E.Balaguruswami www.planet.sourcecode.com www.books.google.com www.knowledgestorm.com
  翻译: