Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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.
2
Index
1.Requirement and analysis4
3.Design Phase7
4.coding.12
3
1.Requirement and analysis
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
Is flight
no
number is
valid
yes
7
a
b
Is the selected
seat number no
valid and is
available?
yes
no yes
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
printf("\t ");
for(i=0;i<60;i++)
printf("_");
printf("\n\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;
}
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>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.
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;
}
}
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,"\nDestination : %s",flight[n]);
for(x=0;x<counter;x++)
fprintf(fp,"(%d) ",seatsBooked[x]);
18
5.Devolopment and maintenance
19