Sei sulla pagina 1di 19

Airlines project

1
CERTIFICATE
This is to certify that that this is the work
done by A.shekar Goud, J.Tejeshwar,
T.Rishabh Singh bearing the Roll no
1441A0455, 479, 4A7 under the guidance of
Mr.Kapil Kumar in the academic year 2014-
15.

Vice Principal Principal


(S.Rama Murthy) (J.Murthy)

2
Index
1.Requirement and analysis4

2.Hardware and software Requirements.6

3.Design Phase7

4.coding.12

5.Devolopment and maintanace..19

3
1.Requirement and analysis

Our project deals with Airlines Ticket Booking System.


This ticket booking system is designed to satisfy the
requirements of an airlines to print the available flights ready to
take off and to be able to book tickets for the available flights
.Each flight contains 100 seats and each seat can only be
booked once. Error message will be displayed when a booked
seat is selected. Once the seats are selected it will proceed to
the bill.

The flights are


1.1411-departs to sydney at 1200 hours
2.1542-departs to Riyadh at 1500 hours
3.2313-departs to Las Vegas at 2300 hours This project of

Airlines Ticket Booking System gives us the basic information


about their services etc.

4
We have done this project using Files in the back end and
Turbo-C in the front end.We kept the interface simple and
intuitive.
text files will be generated for the bills. Throughout the project
the focus has been on presenting information and comments in
an easy and intelligible
manner.

5
2.Hardware and software Requirements
Ram:512mb
processor: pentium
monitor:17" color digital
os:xp
softwares:Turbo:C and M.S.word

6
3.Design Phase

Flow Charts

Start

Print available flights


and scan the flight
number

Is flight
no
number is
valid

yes

Print the seats of the


selected flight and scan b
the seat numbers

7
a

b
Is the selected
seat number no
valid and is
available?

yes

Ask for booking


confirmation

no yes

Print the bill.

8
Frames

This is the welcome screen.we can see the available flights after
pressing Enter.if any key other than enter is pressed the
program will exit.

9
This is the second frame.It has the list of the available
flights.The flights are printed according to the time of
departures.The departed flights will not be displayed.
Entering the flightr number will take us to the third frame
where all the available seats of that flight will be printed.

10
This is the third frame where the available seats are
printed.differentcoloursrepresent different classes.
Once seat selection is confirmed the seat box will be filled with
grey colour.

11
4.coding

The block of code used for printing available flights:


if ((t.ti_hour - 23 ) >= 0) //condition if no flightsare available
{
outtextxy(getmaxx()/2,getmaxy()/2,"NO FLIGHTS AVAILABLE
CURRENTLY PRESS ANY KEY TO EXIT...");
if(kbhit())
exit(1);
}
else
{
//printing available flights
printf("\n\n\n\n\n\n\n\t Flight
No\t\tDestination\t\tDeparture\n");

printf("\t ");
for(i=0;i<60;i++)
printf("_");

printf("\n\n");

if ((t.ti_hour - 12) < 0) // Checking the departure time


printf("\t 1411\t Sydney \t 12:00\n");

12
if ((t.ti_hour - 15) < 0)// Checking the departure time
printf("\t 1542\t Riyadh \t 15:00\n");
if ((t.ti_hour - 23) < 0)// Checking the departure time
printf("\t 2313\t Las Vegas\t 23:00\n");

printf("\t ");
for(i=0;i<60;i++)
printf("_");
printf("\n\n\n\t\t Enter the flight number : ");
scanf("%d",&n); //selecting the flight number
if(n==1411 || n==1542 || n==2313)
n=((n%10)-1);
else
{
printf("\n\n\t\t\t Invalid Selection.");
delay(4000);
goto start;
}

The block of code that prints the available seats:

// displaying the boxes

13
for(i=0,j=0,k=0;k<100;k++,i+=49)
{
if(k%10==0)
{
j+=32;
i=0;
}
poly[0]=getmaxx()/24+10+i;
poly[1]=j-11;
poly[2]=getmaxx()/24+40+i;
poly[3]=j-11;
poly[4]=getmaxx()/24+40+i;
poly[5]=j-4;
poly[6]=getmaxx()/24+10+i;
poly[7]=j-4;

if(k<=9)
setfillstyle(SOLID_FILL,14);

if(k>9 && k<=29)


setfillstyle(SOLID_FILL,4);

if(k>29)
setfillstyle(SOLID_FILL,1);

14
fillpoly(4,poly);
poly[0]=getmaxx()/24+10+i;
poly[1]=j-4;
poly[2]=getmaxx()/24+40+i;
poly[3]=j-4;
poly[4]=getmaxx()/24+40+i;
poly[5]=16+j;
poly[6]=getmaxx()/24+10+i;
poly[7]=16+j;
if(f[n][k]==1)
setfillstyle(SOLID_FILL,7);
else
setfillstyle(EMPTY_FILL,0);
fillpoly(4,poly);

}
// displaying numbers inside the boxes
/* variables
l is used to move the numbers by 6 units with each iteration.

m is used to move the numbers in the y direction by 2 units


after completion of the printing of 10 numbers each time

15
Note:-after printing 10 numbers each time the m is incremented
by 2 units but l which controls the x coordinate is still
at the 10th seat therefore it should be brought to the
first seat and then m should be incremented so that
the 11th number will be printed below the 1st and so on.*/

for(k=1;k<=100;k++,l+=6)
{
gotoxy(7+l,m+3);
sprintf(buff,"%d",k);
puts(buff);
if(k%10==0)
{
m+=2;
l=-6;
}
}

The block of code that prints the bill:


bill:{
cleardevice();

//printf("Total bill for %d tickets booked is


$%d",bill,bill*1500);

16
// line(0,4,400,4);

gotoxy(10,5);
sprintf(buff," BILL\n");
puts(buff);
// line(0,14,400,8);
gotoxy(0,7);
sprintf(buff,"\n-> Flight Number : %d",flightnum[n]);
puts(buff);
gotoxy(0,9);
sprintf(buff,"\n-> Destination : %s",flight[n]);
puts(buff);
gotoxy(0,11);
sprintf(buff,"\n-> No of seats booked : %d",bill);
puts(buff);
gotoxy(0,13);
sprintf(buff,"\n-> Seat no's booked : ");
puts(buff);
sprintf(buff,"%d",counter);
puts(buff);
for(x=0;x<counter;x++)
{
printf(" %d",seatsBooked[x]);

17
// puts(buff);
}
gotoxy(0,16);
sprintf(buff,"\nTotal BILL : $%d ",bill*1500);
puts(buff);
fp=fopen("day1.txt","w+");
fprintf(fp," BILL\n");

fprintf(fp,"\nFlight Number : %d",flightnum[n]);

fprintf(fp,"\nDestination : %s",flight[n]);

fprintf(fp,"\nNo of seats booked : %d",bill);

fprintf(fp,"\nSeat no's booked : ");

for(x=0;x<counter;x++)
fprintf(fp,"(%d) ",seatsBooked[x]);

fprintf(fp,"\nTotal BILL : $%d ",bill*1500);


fclose(fp);
}

18
5.Devolopment and maintenance

This project can be extended by adding advanced


booking and booking cancellations options. Many other things
can also be integrated into this program. Some of them could
be
Adding a password protected access and only letting the
employees to be able to log in and maintain a list of employees
and also a list of their salaries. Things like displaying the arrival
times of the flights can also be integrated into this program.
Since the list of flights used in this program is an array ,the
number of flights can be increased as per the requirement of
the airlines. The files created in the backend can be stacked
together to create an account book or a budget report.

19

Potrebbero piacerti anche