air ticketing

Upload: shilpi-gupta

Post on 29-May-2018

249 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 Air Ticketing

    1/53

    IN HOUSE PROJECTREPORT

    ON

    AIR TICKET

    RESERVATION

    SUBMITTED BY:

    NAMRATA CHAUHAN

    AND

    SAKSHI GUPTA

    1

  • 8/9/2019 Air Ticketing

    2/53

    INDEX

    SL.NO CONTENTS PG.NO SIGN

    1. Introduction

    1.

    1

    Overview Of C++ And Project 5

    2. System Analysis2.

    1

    An Overview Of System Analysis 12

    2.

    2

    Drawback Of Existing System 13

    3. System Design

    3.1

    An Overview To System Design 14

    3.

    2

    Data Flow Diagram 15

    4. System Coding & System Design

    4.

    1

    System Coding 21

    4.

    2

    Outputs 48

    5. Future Scope Of Project 52

    6. Biblography 53

    2

  • 8/9/2019 Air Ticketing

    3/53

    ACKNOWLEGEMENT

    We are extremely grateful and shall remain indebted to

    our guide and our course coordinator Mrs. Shubra

    Saggar for her constant support in the design,

    implementation and evaluation of this project. We are

    thankful to her for constructive criticism and invaluable

    suggestions, which benefited us a lot while developing

    this project on AIR TICKETING SYSTEM. We would

    like to express our warm thanks to her for

    encouragement, cooperation and consent without which

    we might not have been able to accomplish this project.

    Namrata Chauhan,

    Sakshi Gupta,

    Guru Nanak Institute Of Management,

    GGSIPU

    3

  • 8/9/2019 Air Ticketing

    4/53

    CERTIFICATE

    This is to certify that this is a bona fide record of the project

    work done satisfactorily at Guru Nanak Institute Of

    Management, Punjabi Bagh by Namrata Chauhan and

    Sakshi Gupta in partial fulfillment of BCA 4th semester

    examination.

    This report or a similar report on the topic has not been

    submitted for any other examination and does not form part of

    any other course undergone by these candidates.

    Signature of Project Guide

    Mrs. Shubra Saggar

    4

  • 8/9/2019 Air Ticketing

    5/53

    INTRODUCTION

    OVERVIEW OF C++

    1. C++ is an extention of C programming language and

    was created by BJARNE STROUSTSUP in 1980.

    It is a deviation from traditional procedural languages

    in the sense that it follows object oriented

    programming approach (OOP).

    It supports following C++ characters------

    LETTERS

    DIGITS

    SPECIAL SYMBOLS

    WHITE SPACES

    OTHER CHARACTERS

    2. C++ Data Types------

    5

  • 8/9/2019 Air Ticketing

    6/53

    FUNDAMENTAL DATA TYPES

    a. Int DATA TYPE

    b. Char DATA TYPEc. Float DATA TYPE

    d. Double DATA TYPE

    e. Void DATA TYPE

    DERIVED DATA TYPES

    a. Arrays

    b. Functions

    c. Pointers

    d. Reference

    e. Constants

    3. Operators

    I/O Operators

    a. Input Operator (>>)

    b. Output Operator (

  • 8/9/2019 Air Ticketing

    7/53

    f. Logical Operators

    g. Conditional Operators

    4. Tokensa. Identifiers

    b. Keywords

    c. Literals

    d. Constants

    e. Operators

    5. Conditional Statements

    a. Compound Statement

    b. Selection Statement

    c. If Statement

    d. Switch Statement

    6. Loops

    a. For Loop

    b. While Loop

    c. Do While Loop

    7. Jump Statements

    7

  • 8/9/2019 Air Ticketing

    8/53

    a. Go To Statement

    b. Break Statement

    c. Continue Statement

    8. Console I/O Functions

    a. Getchar() and Putchar() Functions

    b. Gets() and Puts() functions

    8

  • 8/9/2019 Air Ticketing

    9/53

    PROVISIONS IN C++

    1. It provides us with int, char, float, arrays, record files.

    Etc.

    2. It provides us function, classes, structures, which help in

    Object Oriented Programming (OOP).

    3. It facilitates the use of various control structures in theform of if, else, while, do-while, for and switch

    9

  • 8/9/2019 Air Ticketing

    10/53

    Overview Of Project

    The objective of this project is to develop a

    computerized solution, which should be able to monitor

    and manage all the activities of Airline reservation system

    by using computer systems. It saves time. The software will

    be GUI based and user friendly.

    Whenever company wants to know about the

    customers details regarding his whereabouts and

    reservation made by him they would not have to look for

    the record manually. So the solution is to maintain the

    details of the customers in the database and verify from

    there.

    The system allows the operators to easily make the

    reservation and issue tickets immediately or after some

    time after the passengers request .

    10

  • 8/9/2019 Air Ticketing

    11/53

    As we know that the airticket reservation involves the

    risk of travelling by antisocial elements also. So thissystem makes a complete record of the passengers, his

    whereabouts, his contact number etc., and query wizard to

    identify the person.

    It also gives information about flight schedule i.e. theflight departure and flight arrival for best possible customer

    support so that the passenger can get quick and easy access

    to the information regarding flights arrival and departure at

    his or her disposal without being troubled.

    11

  • 8/9/2019 Air Ticketing

    12/53

    System Analysis

    An Overview to system analysis

    System analysis phase is considered one of the most

    important phases in the system development life cycle.

    System analysis is done in order to understand the problem,

    which the system is to solve. It is extremely important that

    the developers of the system study the existing system

    thoroughly otherwise it is impossible to satisfy the needs of

    the user. This study will enable the developers to know theintricacies of the existing system and bring out there hidden

    mysteries to the light so that they know exactly what to do

    and what not to do while building the system.

    12

  • 8/9/2019 Air Ticketing

    13/53

    Exiting system with drawbacks

    1. Delay in information search and retrieval.

    2. Wastage of stationary items for updation of various

    files.

    3. Need to process huge physical data, which is time

    consuming.4. Lack of secrecy of information maintenance that

    suspects the reliability of the data.

    5. Impracticality to adopt operation research and

    statistical techniques for efficient management.

    6. Reports presented are not timely and not fully

    accurate.

    13

  • 8/9/2019 Air Ticketing

    14/53

    System Design

    An Overview of system Design

    The most creative and challenging phase of the system

    life cycle is system design. The term design describes both

    a final system and a process by which it is developed. It

    refers to the technical specifications (analogous to the

    engineers blueprints) that will be applied in implementing

    the candidate system. It also includes the constructions of

    program and programme testing. The key question here is

    How should the problem be solved? The major steps in

    design are shown below.

    The first step is to determine how the output is to be

    produced and in what format. Samples of the output (and

    input) are also made available second, input data and

    master files (data base) have to be designed to meet the

    requirements of the proposed output. The operational

    14

  • 8/9/2019 Air Ticketing

    15/53

    (processing) phase is handled through program

    construction and testing, includes a list of the programes

    needed to meet the systems objectives and completedocumentation. Finally, details related to justification of

    the system and an estimate of the impact of the candidate

    system on the user and the organization are documented

    and evaluated by management as a step toward

    implementation.

    In some firms, separate groups of programmers do the

    programming whereas other firms employ analyst

    programmers who do analysis and design as well as code

    programming. For this discussion, we assume that two

    separate persons carry out analysis and programming.

    There are certain functions, through; that the analyst must

    perform while programs are being written operating

    procedures and documentation must be completed.

    Security and auditing procedure must also be developed.

    15

  • 8/9/2019 Air Ticketing

    16/53

    DATA FLOW DIAGRAMS

    1. Reservation

    Sl No. OF Flight number

    operator

    Passenger and class info

    find

    Flight information

    Passenger record

    16

  • 8/9/2019 Air Ticketing

    17/53

    2. List of Passangers

    17

  • 8/9/2019 Air Ticketing

    18/53

  • 8/9/2019 Air Ticketing

    19/53

    4.Passanger information (Passanger records)

    19

  • 8/9/2019 Air Ticketing

    20/53

    5.Delete (Passanger record)

    20

  • 8/9/2019 Air Ticketing

    21/53

    SYSTEM CODING AND OUTPUTS

    //---------------------------------------------------------------------------

    // PROJECT AIR TICKET RESRVATION

    //---------------------------------------------------------------------------

    //---------------------------------------------------------------------------

    // INCLUDED HEADER FILES

    //---------------------------------------------------------------------------

    #include

    #include

    #include

    #include

    #include

    #include

    #include

    #include

    //---------------------------------------------------------------------------

    // THIS CLASS DRAW LINES, BOXES, ETC.

    //---------------------------------------------------------------------------

    class DRAW

    {

    public :

    void LINE_HOR(int, int, int, char) ;void LINE_VER(int, int, int, char) ;

    void BOX(int,int,int,int,char) ;

    } ;

    //---------------------------------------------------------------------------

    21

  • 8/9/2019 Air Ticketing

    22/53

    // THIS CLASS CONTROLS ALL THE FUNCTIONS RELATED TO

    TICKETS

    //---------------------------------------------------------------------------

    class TICKET

    {

    public :

    void ADDITION(void) ;

    void ENQUIRY(void) ;

    char *FLIGHTNO(int) ;

    private :

    void ADD_RECORD(char[10], char[15], char[15], int,

    int) ;

    protected :char fltno[10], from[15], to[15] ;

    int ecofair, exefair ;

    } ;

    //---------------------------------------------------------------------------

    // THIS CLASS CONTROLS ALL THE FUNCTIONS RELATED TO

    PASSENGERS

    //---------------------------------------------------------------------------

    class PASSANGER

    {

    public :

    void ADD_RECORD(int, int, char[26], char[36], int,

    char, char) ;

    void DELETE_TICKET(int) ;

    int DELETE_FLIGHT(int) ;

    void LIST(void) ;

    int LAST_TICKETNO(void) ;

    int SEATS(int) ;int FOUND(int) ;

    char *NAME(int) ;

    protected :

    char Class, name[26], address[36], sex ;

    int slno, age, ticketno ;

    } ;

    22

  • 8/9/2019 Air Ticketing

    23/53

    //---------------------------------------------------------------------------

    // THIS IS DERIVED CLASS WHICH CONTROLS ALL THE

    FUNCTIONS

    // RELATED TO RESERVATION, CANCELLATION, ETC.

    //---------------------------------------------------------------------------

    class RESERVE : public TICKET, public PASSANGER

    {

    public :

    void RESERVATION(void) ;

    void CANCELLATION(void) ;

    void DISPLAY_TICKET(void) ;

    void DELETE_ALL(void) ;

    } ;

    //---------------------------------------------------------------------------

    // FUNCTION TO DRAW HORIZONTAL LINE

    //---------------------------------------------------------------------------

    void DRAW :: LINE_HOR(int coloumn1, int coloumn2, int row, char c)

    {

    for (coloumn1; coloumn1

  • 8/9/2019 Air Ticketing

    24/53

    }

    //---------------------------------------------------------------------------

    // FUNCION TO DRAW BOX

    //---------------------------------------------------------------------------

    void DRAW :: BOX(int column1, int row1, int column2, int row2, char c)

    {

    char ch=218 ;

    char c1, c2, c3, c4 ;

    char c11=196, c12 = 179 ;

    if (c == ch)

    {

    c1=218 ;

    c2=191 ;c3=192 ;

    c4=217 ;

    c11 = 196 ;

    c12 = 179 ;

    }

    else

    {

    c1=c ;

    c2=c ;

    c3=c ;

    c4=c ;

    c11 = c ;

    c12 = c ;

    }

    gotoxy(column1,row1) ;

    cout

  • 8/9/2019 Air Ticketing

    25/53

    LINE_HOR(column1,column2,row2,c11) ;

    column1-- ;

    column2++ ;

    row1++;

    row2--;

    LINE_VER(row1,row2,column1,c12) ;

    LINE_VER(row1,row2,column2,c12) ;

    }

    //---------------------------------------------------------------------------

    // FUNCTION TO ADD GIVEN DATA IN THE TICKET

    FILE(TICKET.DAT)

    //---------------------------------------------------------------------------

    void TICKET :: ADD_RECORD(char t_fltno[10], char t_from[15], char

    t_to[15], int t_ecofair, int t_exefair)

    {

    fstream file ;

    file.open("TICKET.DAT", ios::app) ;

    strcpy(fltno,t_fltno) ;

    strcpy(from,t_from) ;

    strcpy(to,t_to) ;

    ecofair = t_ecofair ;

    exefair = t_exefair ;

    file.write((char *) this , sizeof(TICKET)) ;

    file.close() ;

    }

    //---------------------------------------------------------------------------

    // FUNCTION TO RETURN FLIGHT NO. FOR THE GIVEN S.NO

    //---------------------------------------------------------------------------

    char *TICKET :: FLIGHTNO(int sno){

    fstream file ;

    file.open("TICKET.DAT", ios ::in) ;

    int count=1 ;

    while (file.read((char *) this, sizeof(TICKET)))

    {

    25

  • 8/9/2019 Air Ticketing

    26/53

    if (sno == count)

    break ;

    count++ ;

    }

    file.close() ;

    return fltno ;

    }

    //---------------------------------------------------------------------------

    // FUNCTION TO GIVES DATA TO ADD RECORDS IN TICKET FILE

    //---------------------------------------------------------------------------

    void TICKET :: ADDITION(void)

    {

    fstream file ;file.open("TICKET.DAT", ios::in) ;

    if (!file.fail())

    return ;

    file.close() ;

    ADD_RECORD("KL146","DELHI","MUMBAI",1500,1700) ;

    ADD_RECORD("KL146","MUMBAI","DELHI",1500,1700) ;

    ADD_RECORD("KL156","DELHI","CALCUTTA",1700,1900) ;

    ADD_RECORD("KL156","CALCUTTA","DELHI",1700,1900) ;

    ADD_RECORD("KL166","DELHI","MADRAS",2100,2300) ;

    ADD_RECORD("KL166","MADRAS","DELHI",2100,2300) ;

    ADD_RECORD("KL176","MUMBAI","CALCUTTA",1900,2100) ;

    ADD_RECORD("KL176","CALCUTTA","MUMBAI",1900,2100) ;

    ADD_RECORD("KL186","MUMBAI","MADRAS",1800,2000) ;

    ADD_RECORD("KL186","MADRAS","MUMBAI",1800,2000) ;

    ADD_RECORD("KL196","CALCUTTA","MADRAS",1600,1800) ;

    ADD_RECORD("KL196","MADRAS","CALCUTTA",1600,1800) ;

    }

    //---------------------------------------------------------------------------// FUNCTION TO DISPLAY LIST OF FLIGHTS

    //---------------------------------------------------------------------------

    void TICKET :: ENQUIRY(void)

    {

    clrscr() ;

    26

  • 8/9/2019 Air Ticketing

    27/53

    fstream file ;

    file.open("TICKET.DAT", ios::in) ;

    DRAW d ;

    d.BOX(1,2,80,24,218) ;

    d.LINE_HOR(2,79,4,196) ;

    d.LINE_HOR(2,79,6,196) ;

    d.LINE_HOR(2,79,22,196) ;

    textcolor(GREEN+BLINK) ;

    gotoxy(30,3) ;

    cprintf ("LIST OF THE FLIGHTS") ;

    textcolor(LIGHTGRAY) ;

    textcolor(GREEN) ;

    textbackground(WHITE) ;

    for (int i=2; i

  • 8/9/2019 Air Ticketing

    28/53

  • 8/9/2019 Air Ticketing

    29/53

    } while (!valid) ;

    int i=1 ;

    fstream file ;

    file.open ("TICKET.DAT",ios::in);

    while (file.read((char *) this, sizeof(TICKET)))

    {

    if (sno == i)

    break ;

    i++ ;

    }

    file.close() ;

    strcpy(pfltno,fltno) ;

    if (p.SEATS(sno) >= 250)

    {

    gotoxy(5,21) ;cout

  • 8/9/2019 Air Ticketing

    30/53

    gotoxy(5,5) ;

    cout

  • 8/9/2019 Air Ticketing

    31/53

    }

    } while (!valid) ;

    do

    {

    gotoxy(5,25) ; clreol() ;

    cout

  • 8/9/2019 Air Ticketing

    32/53

    cout

  • 8/9/2019 Air Ticketing

    33/53

    // THIS FUNCTION RETURN THE LAST TICKETNO. IN THE

    PASSANGER FILE

    //---------------------------------------------------------------------------

    int PASSANGER :: LAST_TICKETNO(void)

    {

    fstream file ;

    file.open("PASS.DAT", ios::in) ;

    int count=0 ;

    while (file.read((char *) this, sizeof(PASSANGER)))

    count = ticketno ;

    file.close() ;

    return count ;

    }

    //---------------------------------------------------------------------------

    // THIS FUNCTION RETURN TOTALNO. OF SEATS IN THE

    PASSAGER FILE

    //---------------------------------------------------------------------------

    int PASSANGER :: SEATS(int sno)

    {

    fstream file;

    file.open("PASS.DAT", ios::in) ;

    int count = 0 ;

    while (file.read((char *) this, sizeof(PASSANGER)))

    {

    if (sno == slno)

    count++ ;

    }

    file.close() ;

    return count ;

    }

    //---------------------------------------------------------------------------

    // THIS FUNCTION RETURN 0 IF THE TICKET NO. NOT FOUND IN

    PASSANGER'S FILE

    //---------------------------------------------------------------------------

    int PASSANGER :: FOUND(int tno)

    33

  • 8/9/2019 Air Ticketing

    34/53

    {

    fstream file ;

    file.open("PASS.DAT", ios::in) ;

    int found=0 ;

    while (file.read((char *) this, sizeof(PASSANGER)))

    {

    if (tno == ticketno)

    {

    found = 1 ;

    break ;

    }

    }file.close() ;

    return found ;

    }

    //---------------------------------------------------------------------------

    // THIS FUNCTION RETRNS PASSANGER'S NAME FOR THE GIVEN

    TICKET NO.

    //---------------------------------------------------------------------------

    char *PASSANGER :: NAME(int tno)

    {

    fstream file ;

    file.open("PASS.DAT", ios::in) ;

    while (file.read((char *) this, sizeof (PASSANGER)))

    {

    if (tno == ticketno)

    break ;

    }

    file.close() ;

    return name ;

    }

    //---------------------------------------------------------------------------// THIS FUNCTION DISPLAY THE LIST OF THE PASSANGERS

    //---------------------------------------------------------------------------

    void PASSANGER :: LIST(void)

    {

    clrscr() ;

    34

  • 8/9/2019 Air Ticketing

    35/53

    char t1[10] ;

    int t2, sno, valid ;

    TICKET ticket ;

    ticket.ENQUIRY() ;

    do

    {

    valid = 1 ;

    gotoxy(3,23) ;

    cout

  • 8/9/2019 Air Ticketing

    36/53

    cout

  • 8/9/2019 Air Ticketing

    37/53

    d.LINE_HOR(2,79,6,196) ;

    d.LINE_HOR(2,79,22,196) ;

    gotoxy(2,5) ;

    cprintf(" TICKET NO. NAME

    FLIGHT NO. CLASS ") ;

    textcolor(LIGHTGRAY) ;

    textbackground(BLACK) ;

    }

    else

    row++ ;

    }

    }

    if (!found)

    {

    gotoxy(5,10) ;cout

  • 8/9/2019 Air Ticketing

    38/53

    file.read((char *) this, sizeof(PASSANGER)) ;

    if (file.eof())

    break;

    if (tno != ticketno)

    temp.write((char *) this, sizeof(PASSANGER)) ;

    }

    file.close();

    temp.close() ;

    file.open("PASS.DAT", ios::out) ;

    temp.open("temp.dat", ios::in) ;

    temp.seekg(0,ios::beg) ;

    while ( !temp.eof() )

    {

    temp.read((char *) this, sizeof(PASSANGER)) ;

    if (temp.eof() )break ;

    file.write((char *) this, sizeof(PASSANGER)) ;

    }

    file.close() ;

    temp.close() ;

    }

    //---------------------------------------------------------------------------

    // THIS FUNCTION DELETES ALL PASSANGER RECORD FOR THE

    GIVEN FLIGHT NO.

    //---------------------------------------------------------------------------

    int PASSANGER :: DELETE_FLIGHT(int sno)

    {

    fstream file ;

    file.open("PASS.DAT", ios::in) ;

    fstream temp ;

    temp.open("temp.dat", ios::out) ;

    file.seekg(0,ios::beg) ;int found = 0 ;

    while (!file.eof())

    {

    file.read((char *) this, sizeof(PASSANGER)) ;

    if (file.eof())

    break;

    38

  • 8/9/2019 Air Ticketing

    39/53

    if (sno != slno)

    temp.write((char *) this, sizeof(PASSANGER)) ;

    else

    found = 1 ;

    }

    file.close();

    temp.close() ;

    file.open("PASS.DAT", ios::out) ;

    temp.open("temp.dat", ios::in) ;

    temp.seekg(0,ios::beg) ;

    while ( !temp.eof() )

    {

    temp.read((char *) this, sizeof(PASSANGER)) ;

    if (temp.eof() )

    break ;file.write((char *) this, sizeof(PASSANGER)) ;

    }

    file.close() ;

    temp.close() ;

    return found ;

    }

    //---------------------------------------------------------------------------

    // THIS FUNCTION CANCELS PASSANGER'S TICKET

    //---------------------------------------------------------------------------

    void RESERVE :: CANCELLATION(void)

    {

    clrscr() ;

    char t1[10], ch ;

    int t2, tno, valid ;

    do

    {

    valid =1 ;gotoxy(3,23) ; clreol() ;

    cout

  • 8/9/2019 Air Ticketing

    40/53

    t2 = atoi(t1) ;

    tno = t2 ;

    if (t1[0] == '0')

    {

    valid = 0 ;

    LIST() ;

    clrscr() ;

    }

    } while (!valid) ;

    clrscr() ;

    fstream file ;

    file.open("PASS.DAT", ios::in) ;

    while (file.read((char *) this, sizeof(PASSANGER)))

    if (ticketno == tno)

    break ;file.close() ;

    int i = 1 ;

    file.open("TICKET.DAT",ios::in) ;

    while (file.read((char *) this, sizeof(TICKET)))

    {

    if (slno == i)

    break ;

    i++ ;

    }

    file.close() ;

    PASSANGER p;

    DRAW d;

    d.BOX(15,5,66,21,'*') ;

    d.LINE_HOR(16,65,7,'*') ;

    gotoxy(33,6) ;

    cout

  • 8/9/2019 Air Ticketing

    41/53

    cout

  • 8/9/2019 Air Ticketing

    42/53

    t2 = atoi(t1) ;

    tno = t2 ;

    if (t1[0] == '0')

    return ;

    if (strlen(t1) == 0)

    {

    valid = 0 ;

    LIST() ;

    clrscr() ;

    }

    if (!FOUND(tno) && valid)

    {

    valid = 0;

    gotoxy(3,23) ; clreol() ;

    cout

  • 8/9/2019 Air Ticketing

    43/53

    gotoxy(17,9) ;

    cout

  • 8/9/2019 Air Ticketing

    44/53

    gotoxy(3,20) ;

    cout 12)

    {

    valid = 0 ;

    gotoxy(3,23) ;

    cout

  • 8/9/2019 Air Ticketing

    45/53

    {

    clrscr() ;

    d.BOX(19,6,62,20,218) ;

    textcolor(BLACK) ;

    textbackground(WHITE) ;

    for (int i=7; i

  • 8/9/2019 Air Ticketing

    46/53

    if (ch == '4')

    {

    ticket.ENQUIRY() ;

    gotoxy(2,23) ;

    cout

  • 8/9/2019 Air Ticketing

    47/53

    clrscr() ;

    if (ch == 27 || ch == '0')

    break ;

    else

    if (ch == '1')

    r.DISPLAY_TICKET();

    else

    if (ch == '2')

    r.DELETE_ALL() ;

    }

    }

    }

    }

    47

  • 8/9/2019 Air Ticketing

    48/53

    OUTPUTS

    48

  • 8/9/2019 Air Ticketing

    49/53

    49

  • 8/9/2019 Air Ticketing

    50/53

    50

  • 8/9/2019 Air Ticketing

    51/53

    51

  • 8/9/2019 Air Ticketing

    52/53

    SCOPE AND FUTURE APPLICATION

    Nowadays computerization is domination the though the

    through the systems. Now a days as the time is being a

    most important factor decides a lot of things. And thats

    why efficiency accuracy and speed being the most

    dominating factors.

    So, this kind of software will provide an automated and

    user-friendly solution to the routine performed in

    organization. This will not only enhance the speed of

    working but also enhance the overall efficiency of the

    system.

    52

  • 8/9/2019 Air Ticketing

    53/53

    BIBLOGRAPHY

    1. Complete Reference C++, Herbert Schildt

    2. Teach yourself C++, Herbert Schildt

    3. Object Oriented Programming, Robert Laffore