Top Banner
Project Report On Submitted In Partial Fulfillment for the Award of COMPUTER SCIENCE & ENGINEERING From Uttar Pradesh Technical University Lucknow, U.P. Submitted By: 1
72
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 6th Sem Project Report

Project Report

On

Submitted In Partial Fulfillment for the Award of

COMPUTER SCIENCE & ENGINEERING

From

Uttar Pradesh Technical University Lucknow, U.P.

Submitted By:

SHUBHAM PARETA

MOHD. SUHAIL SIDDIQUI

RAM PRIT YADAV

RAKESH SINGH

PRADEEP KUMAR

2008-2009

B.S.A. College of Engg. & Technology

1

Page 2: 6th Sem Project Report

CERTIFICATE

This is to certify that SHUBHAM PARETA, MOHD. SUHAIL

SIDDIQUI, RAM PRIT YADAV, RAKESH SINGH, PRADEEP KUMAR

have successfully completed their project work on “ AIRLINE RESERVATION “

under the guidance of Mr. PRABHUDATTA ROY , for the partial fulfillment of

their COMPUTER SCIENCE & ENGINEERING in Course 2008-2009 as per

curriculum of UPTU during the academic session 2008-2009

Mr. A. K. Tripathi

HOD of C.S.

(BSACET, Mathura)

GUIDED BY:

Mr. Prabhudatta Roy

2

Page 3: 6th Sem Project Report

PREFACE

A. project is usually kept in the academic curriculum to access a

student’s ability to apply the theoretical knowledge; he has gained

during that particular course; into practical purpose .A project work

accesses a student `s extra curricular assets i .e . His entrepreneurship

management and other related qualities.

The project problem given to us from. “Uttar Pradesh Technical

University U.P” is to design and fabricate a “Airline Reservation”

project.

This project report contains every detail regarding services; offered in hotel.

I hoped that this project report is faultless and would prove as

a source of inspiration for our juniors. Any suggestion regarding its

improvement from our teachers and colleagues would be most welcome.

3

Page 4: 6th Sem Project Report

Acknowledgement

Our project entitled “AIRLINE RESERVATION” was an uphill, climb which had to

be assign in an organized and Disciplined way to reach our target and this become

possible only due to sincere and courteous cooperation shown to us by our teacher and

group members.

There were times when we hade to in counters strange and unforeseen

circumstances, which could have very easily deterred us from goal. But the confidence,

enthusiasm and determination shown by the group are appreciable, as we stood united as

one.

It is my proud privilege to express my heartfelt gratitude and renewable regard

to for abounding and able guidance , inspiration and contractive criticism during the

tenure of the project work .

I am equally grateful to my project Guide Mr. Prabhudatta Roy

For willingness to give me valuable advice and direction me necessary facilities and

encouragement for the completion of this project .

I am highly delighted to extend my sincere thanks to Mr. A. K.

Tripathi and all other teachers of B.S.A.C.E.T. , Mathura for providing us

extra lab facility to complete my project.

SHUBHAM PARETA

MOHD. SUHAIL SIDDIQUI

RAM PRIT YADAV

RAKESH SINGH

PRADEEP KUMAR

(THIRD YEAR C.S. & Engg.)

B.S.A. College of Engg. & Technology

MATHURA

4

Page 5: 6th Sem Project Report

INDEX

1) Introduction:

1.1) Objective1.2) Introduction1.3) Technologies

2) Use case diagram

3) Data flow diagram:

3.1) ‘0’ Level3.2) ‘1’ Level

4) Functionality & Features5) Input & Output6) Requirements7) Conclusion8) Bibliography9) Coding10) Screen Layout

5

Page 6: 6th Sem Project Report

1.1) OBJECTIVE

This project is a simple and abstract version

of the modern day Air Ticketing System. This is

meant for the use of the staff to handle all the

necessary information regarding the different flights

from the airport. This program includes the functions

to add flight records, book flights individually or in a

group. Cancellation and display flight status,

cancellation of tickets and displaying the same.

1.2) INTRODUCTION

6

Page 7: 6th Sem Project Report

In Present age everything is growing with a very rapid rate. So it requires that we change our present working system for being in race of growth. Our project helps in saving time, money, extra paper work etc. The main advantage of our project is that no extra software or hardware is required for this.The main features of ATS are:

1. ATS allows the flight manager to find all the flight meeting passenger’s needs.

2. ATS allows the travel agent to make reservations.

3. ATS allows the travel agent to cancel the reservation.

1.3) TECHNOLOGIES:

C++ For constraints.

2) USE CASE DIAGRAM

7

Page 8: 6th Sem Project Report

Use Case 1: Flight Details

Primary Actors: Flight Manager• Precondition: :Flight manager is logged in• Main Success Scenario:

– User enters flight details– System accepts flight details

Use Case 2: Passenger Details

• Primary Actors: Flight Manager• Precondition: Flight manager is logged in• Main Success Scenario:

– User enters passenger details– System accepts passenger details

Use Case 3: Booking

• Primary Actors: Flight Manager• Precondition: Flight manager is logged in• Main Success Scenario:

– User enters booking details

Use Case 4: Cancellation

• Primary Actors: Flight Manager• Precondition: Flight manager is logged in• Main Success Scenario:

– User cancels the passenger’s details – System updates the details in question

Use Case 5: Quit

8

Page 9: 6th Sem Project Report

Primary Actors: Flight Manager• Precondition: Flight manager is logged in• Main Success Scenario:

– Flight manager enters all the details and clicks the quit option.

– System displays Thank you screen and exits the program.

• Exception Scenario: Passenger enters invalid data. System reenters the choices.

System accepts these details

3)DFD

9

Page 10: 6th Sem Project Report

3.1) LEVEL 0 DFD

The central process is all functions and features of our Air ticketing system, depicted as a single bubble.

Four primary external entities that affect information flow(labeled on arrows) are-flight manager and passengers.

The Flight manager can enter, modify and cancel all the details as given by the passenger.

He is also responsible for inputting the database field/attribute values.

Passenger gives the required details to the flight manager to be entered in the system.

LEVEL 1 DFD

AIR TICKRETING SYSTEM

FLIGHT MANAGER

PASSENGER

10

Page 11: 6th Sem Project Report

‘1’ Level data flow diagram shows some what description about the ‘0’ level data flow diagram i.e. in ‘1’ level data flow diagram we represent the descriptive data of the ‘0’ level data flow diagram and way of representing the relation between different actors & different functions.

4) FUNCTIONALITY & FEATURES:-

Flightdetails

Passengerdetails

Booking

Flight Manager Passenger

Cancellation

Quit

11

Page 12: 6th Sem Project Report

New Reservation

Passenger’s Information

Modify Records

Display Information of Passengers

Cancellation

Quit To System

5) INPUTS :

12

Page 13: 6th Sem Project Report

Ω PASSENGER DETAILS Name of Passenger Sex of Passenger Age of Passenger

Nationality

Ω MODIFICATIONS Ticket No.

Name of Passenger Sex of Passenger Age of Passenger

Nationality

Ω CANCELLATION Ticket No.

13

Page 14: 6th Sem Project Report

REQUIREMENT

Before proceeding to the project details it is necessary to give a brief description of H/W machine on which the entire work is done. It was IBM PC computable machine with a Pentium 4 processor, and 104 keys of keyboard Other description is given bellow:

HARDWARE: A computer system with 256 MB RAM Hard Disk 80GB Pentium 4

OPERATING SYSTEM:

WINDOWS 98,2000,XP,VISTA

SOFTWARE:

Turbo C++ LANGUAGE

14

Page 15: 6th Sem Project Report

Conclusion

This project gives a valuable help to store data into the file as raw

data. It perform all type of work related to air reservation environment. It

also helps us to work directly on the file if we want to save changes, any

record or the contents of records.

In this ATS, we search the records of all the passengers and particular

passenger’s records.

Thank you

15

Page 16: 6th Sem Project Report

BIBLOGRAPHY

1. COMPLETE REFERENCE C++

2. LET US C BY YASHVANT KANETKAR

3. C++ IN DEPTH BY DEEPALI SRIVASTAVA

4. PROGRAMING IN C++ BY E –BALAGURUSWAMI

5. D.S. USING C BY G.S. BALUJA

6. SOME DATA ARE ALSO COLLECTED FROM THE INTERNET

Reference Websites:

i. www.google.com

ii. www.ask.com

iii. www.codesworld.com

16

Page 17: 6th Sem Project Report

COADING

//PROJECT ON AIR TICKET RESERVATION

//*********************************************************

**************

// Required Header files

//*********************************************************

**************

#include <graphics.h>

#include <ctype.h>

#include <iomanip.h>

#include <conio.h>

#include <fstream.h>

#include <string.h>

#include <process.h>

#include <stdio.h>

#include <dos.h>

//*********************************************************

**************

// Structure containing variables for air reservation.

17

Page 18: 6th Sem Project Report

//*********************************************************

**************

struct airway

char name[20], sex, from[20], rstatus[2],nat[10] ;

int passno,age,des ;

;

//

**********************************************************

*************

// Class To Control All The Functions Related To Air Reservation.

//

**********************************************************

*************

class air

private :

airway r ;

void getdata(int) ;

void add() ;

void list() ;

void pinfo() ;

18

Page 19: 6th Sem Project Report

void cancel() ;

void update();

void mod() ;

char select() ;

public :

//graphi();

void nik1() ;

void nik();

;

//

*************************************************************

**********

// FUNCTION NAME : NIK1

// DESCRIPTION : This function opens up the main menu and calls

other

// related functions.

//*********************************************************

**************

void air :: nik1()

//graphi();

do

clrscr() ;

19

Page 20: 6th Sem Project Report

char choice ;

gotoxy(30, 2) ;

cprintf(" M A I N -- M E N U ") ;

gotoxy(30, 7) ;

cprintf("÷ 1 - New Reservation ÷÷");

gotoxy(30, 9) ;

cprintf("÷ 2 - Passenger Info. ÷÷");

gotoxy(30, 11) ;

cprintf("÷ 3 - Modify Record ÷÷") ;

gotoxy(30, 13) ;

cprintf("÷ 4 - Display Information Of Passengers ÷÷") ;

gotoxy(30, 15) ;

cprintf("÷ 5 - Cancellation ÷÷") ;

gotoxy(30, 17) ;

cprintf("÷ 0 - Quit To System ÷÷") ;

gotoxy(34, 22) ;

cprintf("ENTER CHOICE : ") ;

choice = getch() ;

choice = toupper(choice) ;

switch(choice)

case '1' : add() ; break ;

case '3' : mod() ; break ;

case '5' : cancel() ; break ;

case '4' : list() ; break ;

20

Page 21: 6th Sem Project Report

case '2' : pinfo() ; break ;

case '0' : exit(1) ;

case 27 : exit(1) ;

default : cout <<"\a" ;

while(1) ;

//*********************************************************

**************

// FUNCTION NAME : SELECT

// DESCRIPTION : This function opens up a sub-menu for the user

to

// select an aircraft from the list.

//*********************************************************

*************

char air :: select()

char choice ;

do

clrscr() ;

gotoxy(25, 5) ;

cprintf("S E L E C T A F L I G H T") ;

21

Page 22: 6th Sem Project Report

gotoxy(23, 6) ;

gotoxy(27, 9) ;

cprintf("1 - Air India\n") ;

gotoxy(27, 10) ;

cprintf("2 - British Airways\n") ;

gotoxy(27, 11) ;

cprintf("3 - Gulf Airways\n") ;

gotoxy(27, 12) ;

cprintf("4 - United Airlines \n") ;

gotoxy(27, 13) ;

cprintf("5 - Lufthansa \n") ;

gotoxy(27, 15) ;

cprintf("R - Return to Main Menu\n") ;

gotoxy(27, 16) ;

cprintf("Q - Quit to System\n") ;

gotoxy(30, 20) ;

cprintf("Enter Choice : ") ;

choice = getch() ;

choice = toupper(choice) ;

switch(choice)

case '1' : return(choice) ;

case '2' : return(choice) ;

case '3' : return(choice) ;

case '4' : return(choice) ;

22

Page 23: 6th Sem Project Report

case '5' : return(choice) ;

case 'R' : nik1() ;

case 'Q' : exit(1) ;

case 27 : nik1() ;

default : cout <<"\a" ; select() ;

while(1) ;

//*********************************************************

**************

// FUNCTION NAME : GETDATA

// DESCRIPTION : Function to get Passenger Info from User for

Addition

// and Modification

//*********************************************************

**************

void air :: getdata(int p)

fstream joel ;

// r.passno = p ;

char ch;

23

Page 24: 6th Sem Project Report

cout<<" THE ROUTES ARE\n";

cout<<" 1. DELHI - LONDON - DELHI\n" ;

cout<<" 2. DELHI - NEY YORK - DELHI\n";

cout<<" 3. DELHI - PARIS - DELHI\n";

cout<<" 4. DELHI - SWITZERLAND - DELHI\n\n";

cout<<" Please Select Your Route: ";

cin>>r.des;

clrscr();

r.passno = p ;

gotoxy(20,7) ;

cprintf("Passenger No. : ") ;

cout <<r.passno ;

gotoxy(20,9) ;

cprintf("Enter NAME of Passenger : ") ;

gets(r.name) ;

gotoxy(20,10) ;

cprintf("Enter SEX of Passenger(M/F) : ") ;

cin>>r.sex ;

while(1)

gotoxy(34,12);

cout<<" ";

if(r.sex=='m'||r.sex=='M'||r.sex=='f'||r.sex=='F')

break;

gotoxy(34,12);

24

Page 25: 6th Sem Project Report

cout<<"ENTER M OR F"<<endl;

getch();

gotoxy(34,12);

cout<<" ";

gotoxy(20,10) ;

cout << " ";

gotoxy(20,10);

cprintf("Enter SEX of Passenger : ") ;

cin>>r.sex ;

gotoxy(20,11) ;

cprintf("Enter AGE of Passenger : ") ;

cin>>r.age ;

while(1)

gotoxy(34,12);

cout<<" ";

if(r.age>=4 && r.age<=100 )

break;

gotoxy(34,12);

cout << "Enter Correct age";

25

Page 26: 6th Sem Project Report

getch();

gotoxy(34,12);

cout<<" ";

gotoxy(20,11) ;

cout << " ";

gotoxy(20,11) ;

cprintf("Enter AGE of Passenger : ") ;

cin >> r.age ;

gotoxy(20,12);

cprintf("ENTER THE NATIONALITY :");

gets(r.nat);

gotoxy(20,13);

cprintf("STARTING POINT : ") ;

cout<<" DELHI\n";

gotoxy(20,14) ;

cprintf(" DESTINATION : ") ;

switch(r.des)

case 1:

cout<<" LONDON\n";

break;

case 2:

cout<<" NEW YORK\n";

26

Page 27: 6th Sem Project Report

break;

case 3:

cout<<" PARIS\n";

break;

case 4:

cout<<" SWITZERLAND\n";

break;

gotoxy(20,16) ;

cprintf("TICKET NO. : ") ;

cout << r.passno ;

//*********************************************************

**************

// FUNCTION NAME : ADD

// DESCRIPTION : Function to add the data provided from

GETDATA into

// the required file.

//*********************************************************

**************

void air :: add()

air temp ;

27

Page 28: 6th Sem Project Report

int t ;

fstream airs ;

char c, filename[8], choice1, choice2 ;

do

t = 0 ;

c = select() ;

switch(c)

case '1' : strcpy(filename,"Ind.Dat") ; break ;

case '2' : strcpy(filename,"Brit.Dat") ; break ;

case '3' : strcpy(filename,"Gulf.Dat") ; break ;

case '4' : strcpy(filename,"Unit.Dat") ; break ;

case '5' : strcpy(filename,"Luf.Dat") ; break ;

airs.open(filename, ios::in | ios::binary | ios::app) ;

while(airs.read((char *)&temp, sizeof(airway)))

t++ ;

airs.close() ;

do

if (t < 5)

strcpy(r.rstatus, "C") ;

else strcpy(r.rstatus, "W") ;

if(t<8)

t++ ;

clrscr() ;

28

Page 29: 6th Sem Project Report

gotoxy(25,3) ;

cprintf("ADDITION OF NEW PASSENGER") ;

gotoxy(23,4) ;

cprintf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ") ;

gotoxy(20,6) ;

cprintf("Flight Name : ") ;

switch(c)

case '1': cout <<"Air India" ; break ;

case '2': cout <<"British Airways" ; break ;

case '3': cout <<"Gulf Airways" ; break ;

case '4': cout <<"United Airlines" ; break ;

case '5': cout <<"Lufthansa" ; break ;

getdata(t) ;

gotoxy(20,16) ;

cprintf("STATUS : ") ;

if (t <5)

cout <<"\aCONFIRMED" ;

else cout <<"\aWAITING LIST";

getch() ;

airs.open(filename, ios::out | ios::binary | ios::app) ;

airs.write((char *)&r, sizeof(airway)) ;

airs.close() ;

else

29

Page 30: 6th Sem Project Report

clrscr() ;

gotoxy(22,20) ;

cout <<"NO MORE TICKETS AVAILABLE FOR THIS

Flight\a" ;

getch() ;

gotoxy(12,25) ;

cout <<"\aDo you wish to make any more reservation on this

Flight (Y/N)" ;

do

choice1 = getch() ;

choice1 = toupper(choice1) ;

while((choice1 != 'Y') && (choice1 != 'N')) ;

while(choice1 == 'Y') ;

gotoxy(1,25) ;

clreol() ;

gotoxy(12,25) ;

cout << "Do you wish to make any more reservation on any

Flight (Y/N)" ;

do

choice2 = getch() ;

choice2 = toupper(choice2) ;

30

Page 31: 6th Sem Project Report

while((choice2 != 'Y') && (choice2 != 'N')) ;

while(choice2 == 'Y') ;

//*********************************************************

**************

// FUNCTION NAME : PINFO

// DESCRIPTION : Function to get full details of a particular

Passenger

//*********************************************************

**************

void air :: pinfo()

fstream airs ;

int p , k=0;

char c, filename[8] ;

c = select() ;

switch(c)

case '1' : strcpy(filename,"Ind.Dat") ; break ;

case '2' : strcpy(filename,"Brit.Dat") ; break ;

case '3' : strcpy(filename,"Gulf.Dat") ; break ;

31

Page 32: 6th Sem Project Report

case '4' : strcpy(filename,"Unit.Dat") ; break ;

case '5' : strcpy(filename,"Luf.Dat") ; break ;

clrscr() ;

gotoxy(10,3) ;

cout <<"Enter Passenger Number : " ;

cin >>p ;

airs.open(filename, ios::in | ios::binary | ios::app) ;

while(airs.read((char *)&r, sizeof(airway)))

k++;

airs.close();

if(p>k)

clrscr() ;

gotoxy(25,25) ;

cout <<"Record Not Found......\a" ;

getch() ;

else

airs.open(filename, ios::in | ios::binary | ios::app) ;

while(airs.read((char *)&r, sizeof(airway)))

if (r.passno == p)

clrscr() ;

32

Page 33: 6th Sem Project Report

gotoxy(27,3) ;

cprintf("PASSENGER INFORMATION") ;

gotoxy(23,6) ;

cprintf("Flight Name : ") ;

switch(c)

case '1': cout <<"Air India" ; break ;

case '2': cout <<"British Airways" ; break ;

case '3': cout <<"Gulf Airways" ; break ;

case '4': cout <<"United Airlines" ; break ;

case '5': cout <<"Lufthansa" ; break ;

gotoxy(23,7) ;

cprintf("Passenger No. : ") ;

cout <<r.passno ;

gotoxy(23,9) ;

cprintf("NAME of Passenger : ") ;

cout <<r.name ;

gotoxy(23,10) ;

cprintf("SEX of Passenger : ") ;

cout <<r.sex ;

gotoxy(23,11) ;

cprintf("AGE of Passenger : ") ;

cout <<r.age ;

33

Page 34: 6th Sem Project Report

gotoxy(23,12);

cprintf("NATIONALITY : ");

cout<<r.nat;

gotoxy(23,13) ;

cprintf("STARTING POINT : ") ;

cout <<"DELHI" ;

gotoxy(23,14) ;

cprintf("DESTINATION : ") ;

switch(r.des)

case 1:

cout<<"LONDON\n";

break;

case 2:

cout<<"NEW YORK\n";

break;

case 3:

cout<<"PARIS\n";

break;

case 4:

cout<<"SWITZERLAND\n";

break;

gotoxy(23,16) ;

cprintf("TICKET NO. : ") ;

cout <<r.passno ;

gotoxy(23,17) ;

cprintf("STATUS : ") ;

34

Page 35: 6th Sem Project Report

if(strcmp(r.rstatus, "W") == 0)

cout <<"WAITING LIST" ;

else cout <<"CONFIRMED" ;

gotoxy(5,25) ;

cout <<"Press Any Key To Continue........" ;

getch() ;

airs.close() ;

//*********************************************************

**************

// FUNCTION NAME : LIST

// DESCRIPTION : Function to show passenger list flight wise.

//*********************************************************

**************

void air :: list()

fstream airs ;

char c, filename[8] ;

c = select() ;

switch(c)

35

Page 36: 6th Sem Project Report

case '1' : strcpy(filename,"Ind.Dat") ; break ;

case '2' : strcpy(filename,"Brit.Dat") ; break ;

case '3' : strcpy(filename,"Gulf.Dat") ; break ;

case '4' : strcpy(filename,"Unit.Dat") ; break ;

case '5' : strcpy(filename,"Luf.Dat") ; break ;

clrscr() ;

gotoxy(29,3) ;

cprintf("P A S S E N G E R L I S T") ;

gotoxy(27,4) ;

cprintf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ") ;

gotoxy(33,5) ;

switch(c)

case '1': cprintf("AIR INDIA") ; break ;

case '2': cprintf("BRITISH AIRWAYS") ; break ;

case '3': cprintf("GULF AIRWAYS") ; break ;

case '4': cprintf("UNITED AIRLINES") ; break ;

case '5': cprintf("LUFTHANSA") ; break ;

gotoxy(3,7) ;

cprintf(" Passenger Number ") ;

gotoxy(27,7) ;

cprintf(" P A S S E N G E R - N A M E ") ;

36

Page 37: 6th Sem Project Report

gotoxy(62,7) ;

cprintf(" Reservation Status") ;

int i = 9 ;

airs.open (filename, ios::in | ios::binary) ;

while(airs.read((char *)&r, sizeof(airway)))

gotoxy(10,i) ;

cout <<r.passno ;

gotoxy(30,i) ;

cout <<r.name ;

gotoxy(66,i) ;

if (strcmp(r.rstatus, "C") == 0)

cout <<"CONFIRMED" ;

else

cout <<"WAITING LIST" ;

i++ ;

gotoxy(25,25) ;

cprintf("\aPress Any Key To Continue..............") ;

getch() ;

airs.close() ;

37

Page 38: 6th Sem Project Report

//*********************************************************

**************

// FUNCTION NAME : MOD

// DESCRIPTION : Function to get modify ticket details entered

during

// reservation.

//*********************************************************

**************

void air :: mod()

update();

add();

getch() ;

//*********************************************************

**************

// FUNCTION NAME : CANCEL

// DESCRIPTION : Function to cancel a ticket.

//*********************************************************

**************

void air :: cancel()

38

Page 39: 6th Sem Project Report

fstream airs, airs1 ;

int p,k=0 ;

char c, filename[8] ;

c = select() ;

switch(c)

case '1' : strcpy(filename,"Ind.Dat") ; break ;

case '2' : strcpy(filename,"Brit.Dat") ; break ;

case '3' : strcpy(filename,"Gulf.Dat") ; break ;

case '4' : strcpy(filename,"Unit.Dat") ; break ;

case '5' : strcpy(filename,"Luf.Dat") ; break ;

clrscr() ;

gotoxy(10,3) ;

cout <<"Enter Passenger Number : " ;

cin >>p ;

airs.open(filename, ios::in | ios::binary | ios::app) ;

while (airs.read((char *)&r, sizeof(airway)))

k++ ;

airs.close();

if(p>k)

clrscr();

gotoxy (25,24);

cout<<"\aPASSENGER NUMBER DOES NOT EXIST";

getch();

39

Page 40: 6th Sem Project Report

return;

clrscr() ;

gotoxy(25,3) ;

cprintf(" CANCELLATION OF TICKET ") ;

airs.open(filename, ios::in | ios::binary) ;

airs1.open("Temp.Dat", ios::out | ios::binary) ;

while (airs.read((char *)&r, sizeof(airway)))

if (r.passno > p)

r.passno-- ;

airs1.write((char *)&r, sizeof(airway)) ;

else if (r.passno < p)

airs1.write((char *)&r, sizeof(airway)) ;

airs.close() ;

airs1.close() ;

remove(filename) ;

rename("Temp.Dat", filename) ;

airs.open(filename, ios::in | ios::binary) ;

airs1.open("Temp.Dat", ios::out | ios::binary) ;

while (airs.read((char *)&r, sizeof(airway)))

if (r.passno <= 5)

strcpy(r.rstatus, "C") ;

40

Page 41: 6th Sem Project Report

else

strcpy(r.rstatus, "W") ;

airs1.write((char *)&r, sizeof(airway)) ;

airs.close() ;

airs1.close() ;

remove(filename) ;

rename("Temp.Dat", filename) ;

clrscr() ;

gotoxy(25,24) ;

cout <<"\a Ticket Successfully Cancelled......" ;

getch() ;

//*********************************************************

**************

// FUNCTION NAME : UPDATE

// DESCRIPTION : Function to update a ticket.

//*********************************************************

**************

void air :: update()

fstream airs, airs1 ;

int p,k=0 ;

char c, filename[8] ;

41

Page 42: 6th Sem Project Report

c = select() ;

switch(c)

case '1' : strcpy(filename,"Ind.Dat") ; break ;

case '2' : strcpy(filename,"Brit.Dat") ; break ;

case '3' : strcpy(filename,"Gulf.Dat") ; break ;

case '4' : strcpy(filename,"Unit.Dat") ; break ;

case '5' : strcpy(filename,"Luf.Dat") ; break ;

clrscr() ;

gotoxy(10,3) ;

cout <<"Enter Passenger Number : " ;

cin >>p ;

airs.open(filename, ios::in | ios::binary | ios::app) ;

while (airs.read((char *)&r, sizeof(airway)))

k++ ;

airs.close();

if(p>k)

clrscr();

gotoxy (25,24);

cout<<"\aPASSENGER NUMBER DOES NOT EXIST";

getch();

return;

clrscr() ;

42

Page 43: 6th Sem Project Report

gotoxy(25,3) ;

cprintf(" CANCELLATION OF TICKET ") ;

airs.open(filename, ios::in | ios::binary) ;

airs1.open("Temp.Dat", ios::out | ios::binary) ;

while (airs.read((char *)&r, sizeof(airway)))

if (r.passno > p)

r.passno-- ;

airs1.write((char *)&r, sizeof(airway)) ;

else if (r.passno < p)

airs1.write((char *)&r, sizeof(airway)) ;

airs.close() ;

airs1.close() ;

remove(filename) ;

rename("Temp.Dat", filename) ;

airs.open(filename, ios::in | ios::binary) ;

airs1.open("Temp.Dat", ios::out | ios::binary) ;

while (airs.read((char *)&r, sizeof(airway)))

if (r.passno <= 5)

strcpy(r.rstatus, "C") ;

else

strcpy(r.rstatus, "W") ;

airs1.write((char *)&r, sizeof(airway)) ;

43

Page 44: 6th Sem Project Report

airs.close() ;

airs1.close() ;

remove(filename) ;

rename("Temp.Dat", filename) ;

clrscr() ;

gotoxy(15,12) ;

cout <<"\a Press Enter to update the record......" ;

getch() ;

//*********************************************************

***************

// Main Function

//*********************************************************

***************

void main()

air obj ;

obj.nik();

clrscr();

obj.nik1() ;

44

Page 45: 6th Sem Project Report

void air:: nik()

char msg[33];

int gd=DETECT,gm,x1,x2,y1,y,y2,s=30,j,w,S,stangle;

int i,r;

//int dly=160,dly1=30;//110 40

initgraph(&gd,&gm,"c:\\tc\\bgi");

setcolor(15);

line (320-150,320-13,320+150,320-13);

line (320-150,320+12,320+150,320+12);

line (320-150,320-13,320-150,320+12);

line (320+150,320+12,320+150,320-13);

gotoxy(20,23);

printf("LOADING . . .");

for ( x1=171,x2=171,y1=308,y2=331,y=1,S=0;x1<470;x1++,x2+

+,y++,S++)

setcolor(4);

line (x1,y1,x2,y2);

w=(x1-169)/3;

for ( j=34; j<=78; j++)

gotoxy(j,23) ;

printf(" ");

45

Page 46: 6th Sem Project Report

gotoxy(34,23);

printf("%d%",w);

if (x2>270) s=45; if (x2>370) s=10;

if (x2==320)

delay(999);

else

delay(s);

delay(800);

for (j=27; j<=78; j++)

gotoxy(j,23) ;

printf(" ") ;

gotoxy(28,23);

printf("COMPLETED");

gotoxy(20,25);

//clrscr();

cleardevice();

/* End of First Griphics Portion */

for (i=1;i<=10;i++)

if(i==7)

continue;

else

46

Page 47: 6th Sem Project Report

setcolor(i);

settextstyle( DEFAULT_FONT, HORIZ_DIR, i);

moveto(40,120);

outtext("PROJECT");

delay(300);

// clrscr();

cleardevice();

for ( i=1;i<7;i++)

setcolor(i);

settextstyle( DEFAULT_FONT, HORIZ_DIR, i);

moveto(120,150);

outtext("ON C++ ");

delay(300);

//clrscr();

cleardevice();

for ( i=3;i<=9;i++)

if(i==7)

continue;

else

setcolor(i);

47

Page 48: 6th Sem Project Report

settextstyle( TRIPLEX_FONT, HORIZ_DIR, i);

moveto(40,120);

outtext("Developed");

delay(250);

//clrscr();

cleardevice();

/* End of Second Graphics Portion */

for ( i=1;i<=10;i++)

if(i==7)

continue;

else

setcolor(i);

settextstyle( DEFAULT_FONT, HORIZ_DIR, i);

moveto(230,160);

outtext("BY:-");

delay(250);

//clrscr();

cleardevice();

for ( i=1;i<=3;i++)

setcolor(i+9);

settextstyle( DEFAULT_FONT, HORIZ_DIR, i);

48

Page 49: 6th Sem Project Report

moveto(50,120);

outtext("MOHD. SUHAIL SIDDIQUI");

delay((i*2)*80);

//clrscr();

cleardevice();

for ( i=1;i<=3;i++)

setcolor(i+9);

settextstyle( DEFAULT_FONT, HORIZ_DIR, i);

moveto(80,120);

outtext("SHUBHAM PARETA");

delay(i*200);

//clrscr();

cleardevice();

for ( i=1;i<=3;i++)

setcolor(i+9);

settextstyle( DEFAULT_FONT, HORIZ_DIR, i);

moveto(80,120);

outtext("RAM PRIT YADAV");

delay(i*500);

//clrscr();

cleardevice();

for ( i=1;i<=3;i++)

49

Page 50: 6th Sem Project Report

setcolor(i+9);

settextstyle( DEFAULT_FONT, HORIZ_DIR, i);

moveto(80,120);

outtext("RAKESH SINGH");

delay(i*500);

//clrscr();

cleardevice();

for ( i=1;i<=3;i++)

setcolor(i+9);

settextstyle( DEFAULT_FONT, HORIZ_DIR, i);

moveto(80,120);

outtext("PRADEEP KUMAR");

delay(i*500);

//clrscr();

cleardevice();

for(i=1;i<=20;i++)

setbkcolor(0);

setcolor(8);

settextstyle(6,0,5);

settextjustify(1,1);

setcolor(5);

outtextxy(325,110,"PROJECT");

delay(250);

outtextxy(320,170,"AIRLINE RESERVATION");

50

Page 51: 6th Sem Project Report

delay(250);

settextstyle(4,0,4);

setcolor(20);

outtextxy(320,220,"Guided By:-");

delay(450);

setcolor(30);

outtextxy(320,300,"Mr.Rajesh Singh");

setcolor(3);

delay(4000);

cleardevice();

break;

setbkcolor(0);

setcolor(8);

ellipse(320,240,0,390,310,150);

settextstyle(8,0,4);

settextjustify(1,1);

setcolor(5);

outtextxy(325,110,"PROJECT");

delay(450);

outtextxy(320,170,"AIRLINE RESERVATION");

delay(450);

settextstyle(4,0,4);

setcolor(20);

outtextxy(320,200,"Presented By:");

delay(450);

outtextxy(320,305,"Mohd. Suhail Siddiqui");

settextstyle(8,0,4);

51

Page 52: 6th Sem Project Report

setcolor(3);

delay(450);

outtextxy(320,235,"Shubham Pareta");

outtextxy(320,275,"Ram Prit Yadav");

outtextxy(320,340,"Rakesh Singh");

outtextxy(320,365,"Pradeep Kumar");

while(kbhit()==0)

for (stangle=0;!kbhit();stangle++)

setcolor(7);

ellipse(320,240,stangle,stangle+20,310,150);

ellipse(320,240,stangle+180,stangle+200,310,150);

delay(6);

setcolor(8);

ellipse(320,240,stangle-1,stangle+19,310,150);

ellipse(320,240,stangle-1+180,stangle+199,310,150);

// getch();

delay(500);

getch();

cleardevice();

closegraph();

clrscr();

52

Page 53: 6th Sem Project Report

SCREEN LEYUT

53

Page 54: 6th Sem Project Report

54

Page 55: 6th Sem Project Report

55

Page 56: 6th Sem Project Report

56