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];
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)
{
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