oop term paper

Upload: radheshyam-singh

Post on 08-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/7/2019 oop term paper

    1/23

    Term paper cse-202

    TITLE :-Design A Program For Hotel Management System

    Submitted to :submitted by:

    Ms. Baljinder Kaur Rahul Dhiman

    Roll no. B-80

    10907542

    B.Tech CSESec H0901

    1 | P a g e

  • 8/7/2019 oop term paper

    2/23

    Index

    Introduction

    I. Key Features

    II. Hotel Master

    III. Account Master

    IV. Project description

    V. Various classes used in this program are

    VI. Various functions used in this program

    VII. Hardware Used

    VIII. Software Used

    IX. Compatibility

    X. Conclusion

    XI. Coding

    2 | P a g e

  • 8/7/2019 oop term paper

    3/23

    Introduction

    This project is about developing a program for managing the day to day statistics

    of a hotel and automation of the reservation system. This program enables a

    reception clerk to manage the check in check out data of various customers coming

    into the hotel. An easy to operate user friendly software that is Committed to meet

    the all requirements to manage small, medium And big scale hotels.

    Hotel Management System is one of the leading software for complete

    management of your Hotel; it can manage the reception, restaurant, inventory and

    accounts excellently.

    The hotel management software provides all kinds of record keeping feature

    required in a hotel like day books, daily business book, Preparation of OFI and

    many more automatically.

    3 | P a g e

  • 8/7/2019 oop term paper

    4/23

  • 8/7/2019 oop term paper

    5/23

    Prepare the complete kot report and NCKOT report.

    Hotel Reports:

    All kinds of hotel reports can be generated in seconds and you can view and print

    them easily.

    Day books

    Daily business report.

    Local call report.

    STD call report.

    Laundry report.

    Cash record.

    Account Master

    Heads:

    The hotel management software includes all principal heads of commercial field.

    We can also customize the heads per requirement.

    Accounting Reports:

    The hotel management software provide facility to view and print

    Ledger list.

    Ledger books with daily/summary options.

    Trial balance with closing balance and detailed options.

    Balance Sheets, quick view of current assets and liabilities.

    Reports of every head can also be generated on the closing and detailed

    based.

    Project description

    5 | P a g e

  • 8/7/2019 oop term paper

    6/23

    The program uses the extensively the concept of classes along with file handling of

    C++ all the concepts used in this program are described below in details.

    CLASSES:-

    A class is an expanded concept of a data structure: instead of holding only data, itcan hold both data and functions.

    An object is an instantiation of a class. In terms of variables, a class would be the

    type, and an object would be the variable.

    Classes are generally declared using the keyword class, with the following format:

    class class_name {

    access_specifier_1:member1;

    access_specifier_2:

    member2;

    ...

    } object_names;

    Where class_name is a valid identifier for the class, object_names is an optional

    list of names for objects of this class. The body of the declaration can contain

    members, that can be either data or function declarations, and optionally access

    specifiers.

    Graphics:-Graphics has been used in this program to draw vertical and horizontalline for creating rows and columns in order to make the interface more

    comprehensive and user friendly.

    File handling:-The program also uses extensively the concept of file handling.Without file handling storing the data of the customers isnt possible. The program

    creates files namely CUSTOMER.DAT to store the customers details such as

    1. Customer name

    2. No of guests with the customer

    3. Customers nationality

    4. Customers address

    5. Customers phone no

    6. Customers passport no. etc

    6 | P a g e

  • 8/7/2019 oop term paper

    7/23

    .

    Compatibility

    Hardware Compatibility:-

    Program compatible with

    1. Pentium iv processor or above

    2. Amd athlaon

    Software Compatibility:-

    Program compatible with

    1. OPENSUSE 9 or above.

    2. Fedora 8 or above

    3. Ubuntu 4 or above

    4. Redhat 7 or above.

    Conclusion

    This is a very useful program which enables a reception clerk to manage the check

    in check out data of various customers coming into the hotel. An easy to operate

    user friendly software that is Committed to meet the all requirements to manage

    small, medium And big scale hotels.

    Coding

    // PROJECT ON HOTEL MANAGEMENT

    # include

    # include

    # include

    # include

    7 | P a g e

  • 8/7/2019 oop term paper

    8/23

    # include

    # include

    # include

    # include

    # include

    # include

    # include

    fstream f,f1,f2,f3,f4,f5,f6,f7,f8;

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

    // CLASS NAME : Hotel

    // DETAILS : IT CONTROLS OVER ALL FUNCTIONING

    // OF THE HOTEL

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

    class HOTEL

    {

    char array[100];

    struct bill_restaurant_bar

    {

    long brestaurant,bbar;

    } b[100];

    struct booking_data

    {

    long charge,roomno;

    char name[25],address[75],telno[10],date[11],roomtype[15];

    } d;

    struct check_out_data

    8 | P a g e

  • 8/7/2019 oop term paper

    9/23

    {

    char name[25],address[75],telno[10],date[11],odate[11],otime[6];

    int roomno;

    } C;

    struct cancellation_data

    {

    char name[25],address[75],telno[10];

    } D;

    struct member_swimming_pool_data

    {

    char name[25],address[75],telno[10],date[11];

    int memno;

    } ms;

    struct member_gym_data

    {

    char name[25],address[75],telno[10],date[11];

    int memno;

    } mg;

    public:

    void booking();

    void check_in();

    void check_out();

    void cancellation();

    void taxi_service();

    void restaurant();

    void bar();

    9 | P a g e

  • 8/7/2019 oop term paper

    10/23

    void swimming_pool();

    void gymnasium();

    void games();

    void view_data();

    } H;

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

    // FUNCTION NAME : BOOKING

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

    void HOTEL::booking ()

    {

    textcolor(2);

    clrscr();

    int c=0;

    //FINDING AN UNOCCUPIED ROOM

    f.open("ARRAY.DAT",ios::in|ios::binary);

    f.read((char *)&array,sizeof(array));

    while(array[c]!='e') c++;

    array[c]='o';

    f.close();

    f.open("ARRAY.DAT",ios::out|ios::binary);

    f.write((char *)&array,sizeof(array));

    f.close();

    f1.open("HOT.EL",ios::app|ios::binary);

    d.roomno=c+1;

    //DATA OF THE CUSTOMER

    cout

  • 8/7/2019 oop term paper

    11/23

    "

  • 8/7/2019 oop term paper

    12/23

    int roomcode;

    REDO:

    coutroomcode;

    switch(roomcode)

    {

    case 1 : strcpy(d.roomtype,"ROYAL SUITE");

    d.charge=20000;

    break;

    case 2 : strcpy(d.roomtype,"SUPER DELUXE");

    d.charge=15000;

    break;

    case 3 : strcpy(d.roomtype,"DELUXE");

    d.charge=10000;

    break;

    case 4 : strcpy(d.roomtype,"DOUBLE BED");

    d.charge=5000;

    break;

    case 5 : strcpy(d.roomtype,"SINGLE BED");

    d.charge=2000;

    break;

    default: cout

  • 8/7/2019 oop term paper

    13/23

    cout

  • 8/7/2019 oop term paper

    14/23

    clrscr();

    coutrn;

    f1.open("HOT.EL",ios::in|ios::binary);

    do f1.read((char *)&d,sizeof(d)); while(d.roomno!=rn);

    cout

  • 8/7/2019 oop term paper

    15/23

    cin>>rn;

    char od[11],ot[6];

    cout

  • 8/7/2019 oop term paper

    16/23

    "

  • 8/7/2019 oop term paper

    17/23

    if(yy1%4==0) { p=29; q=28; }

    else if(yy2%4==0) { p=28; q=29; }

    else { p=28; q=28; }

    int cy[12]={ 31,p,31,30,31,30,31,31,30,31,30,31 };

    int ny[12]={ 31,q,31,30,31,30,31,31,30,31,30,31 };

    if(yy1==yy2 && mm1==mm2 && dd1==dd2) tariff=d.charge;

    else

    {

    if(yy1==yy2)

    {

    if(mm1==mm2) tariff=d.charge*(dd2-dd1);

    else

    {

    r=cy[mm1-1]-dd1+dd2;

    for(int l=mm1;l

  • 8/7/2019 oop term paper

    18/23

    int c1,c2;

    c1=(ot[0]-48)*10+(ot[1]-48);

    c2=(ot[3]-48)*10+(ot[4]-48);

    if(yy1==yy2 && mm1==mm2 && dd1==dd2);

    else if(c1>12) tariff+=d.charge;

    else if(c1==12 && c2>0) tariff+=d.charge;

    cout

  • 8/7/2019 oop term paper

    19/23

    while(f1)

    {

    if(d.roomno!=rn)

    {

    e.write((char *)&d,sizeof(d));

    f1.read((char *)&d,sizeof(d));

    }

    else f1.read((char *)&d,sizeof(d));

    }

    e.close();

    f1.close();

    f1.open("HOT.EL",ios::out|ios::binary);

    e.open("F.DAT",ios::in|ios::binary);

    e.read((char *)&d,sizeof(d));

    while(e)

    {

    f1.write((char *)&d,sizeof(d));

    e.read((char *)&d,sizeof(d));

    }

    e.close();

    f1.close();

    //MAKING THE ROOM OCCUPIED BY THE CUSTOMER AS UNOCCUPIED

    f.open("ARRAY.DAT",ios::in|ios::binary);

    f.read((char *)&array,sizeof(array));

    array[rn-1]='e';

    f.close();

    19 | P a g e

  • 8/7/2019 oop term paper

    20/23

    f.open("ARRAY.DAT",ios::out|ios::binary);

    f.write((char *)&array,sizeof(array));

    f.close();

    gotoxy(25,25);

    cout

  • 8/7/2019 oop term paper

    21/23

  • 8/7/2019 oop term paper

    22/23

    {

    e.write((char *)&d,sizeof(d));

    f1.read((char *)&d,sizeof(d));

    }

    else f1.read((char *)&d,sizeof(d));

    }

    e.close();

    f1.close();

    f1.open("HOT.EL",ios::out|ios::binary);

    e.open("F1.DAT",ios::in|ios::binary);

    e.read((char *)&d,sizeof(d));

    while(e)

    {

    f1.write((char *)&d,sizeof(d));

    e.read((char *)&d,sizeof(d));

    }

    e.close();

    f1.close();

    gotoxy(25,25);

    cout

  • 8/7/2019 oop term paper

    23/23

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

    settextstyle(10,0,1);

    int x=40,y=10;

    setcolor(BROWN);

    outtextxy(50,20,"I am staying in this hotel");

    outtextxy(x,y,".");

    setcolor(CYAN);

    outtextxy(50,60,"I am not staying in this hotel");

    char W;

    int count=0;

    do

    {

    count++;

    W=getch();

    23 | P a g e