Computer Investigatory Project(Hotel Management System)

download Computer Investigatory Project(Hotel Management System)

of 64

Transcript of Computer Investigatory Project(Hotel Management System)

  • 8/10/2019 Computer Investigatory Project(Hotel Management System)

    1/64

    MBSPUBLICSCHOOL

    2014-15

    COMPUTER SCIENCE

    INVESTIGATORY PROJECT

    HOTEL MANAGEMENT SYSTEM

    Name:- Ayashkant Mishra

    Class:- XII

    Section:- A

    Roll No:-

  • 8/10/2019 Computer Investigatory Project(Hotel Management System)

    2/64

    ~ 1 ~

    M B S Public School

    Department Of Computer Science

    CERTIFIC TE

    This is to certify that Ayashkant Mishra, a studentof class XII-A has successfully completed the research on thebelow mentioned project under the guidance of Mr. ChaitanyaBahadur( Subject Teacher ) during the year 2014-15 in partialfulfillment of Computer Science practical examination conductedby AISSCE, New Delhi.

    Signature of External Examiner Signature of Computer Science teacher

  • 8/10/2019 Computer Investigatory Project(Hotel Management System)

    3/64

    ~ 2 ~

    CKNOWLEDGEMENT

    Primarily I would thank God for being able tocomplete this project with success. Then I would like to thank myComputer Science teacher Mr. Chaitanya Bahadur , whosevaluable guidance has been the ones that helped me patch thisproject and make it full proof success his suggestions and hisinstructions has served as the major contributor towards thecompletion of the project.

    Then I would like to thank my parents and friends whohave helped me with their valuable suggestions and guidance hasbeen helpful in various phases of the completion of the project.

    Last but not the least I would like to thank myclassmates who have helped me a lot.

    Ayashkant Mishra

  • 8/10/2019 Computer Investigatory Project(Hotel Management System)

    4/64

    ~ 3 ~

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

    // PROJECT HOTEL-MANAGEMENT

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

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

    // INCLUDED HEADER FILES

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

    #include"graf.cpp"

    #include

    #include

    #include

    #include

    #include

    #include

  • 8/10/2019 Computer Investigatory Project(Hotel Management System)

    5/64

    ~ 4 ~

    #include

    #include

    #include

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

    // THIS CLASS CONTAINS FUNTIONS FOR FOOD

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

    class food

    {

    private:

    fstream p1;

    int c;

    char ap;

    struct fd

    {

    char name[55];

  • 8/10/2019 Computer Investigatory Project(Hotel Management System)

    6/64

    ~ 5 ~

    float price;

    }f;

    public:

    food()

    {

    c=0;

    }

    void food_menu(void);

    void app_fmenu(void);

    void food_bill();

    void del_all();

    };

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

    // FUNCTION FOR DISPLAYING FOOD MENU

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

    void food::food_menu(void)

    {

    cleardevice();

  • 8/10/2019 Computer Investigatory Project(Hotel Management System)

    7/64

    ~ 6 ~

    setfillstyle(7,1);

    floodfill(0,0,4);

    setfillstyle(7,10);

    bar(17,40,605,420);

    rectangle(17,40,605,420);

    setfillstyle(1,10);

    bar(24,47,598,413);

    rectangle(24,47,598,413);

    p1.close();

    c=0;

    p1.open("food.txt",ios::in|ios::binary);

    outtextxy(30,50,"S.N. ITEM NAMEPRICE");

    gotoxy(4,5);

    char h[5],pr[15];

    while(p1.read((char*)&f,sizeof(f)))

    {

    c++;

    settextstyle(4,0,1);

  • 8/10/2019 Computer Investigatory Project(Hotel Management System)

    8/64

    ~ 7 ~

    itoa(c,h,10);

    outtextxy(40,60+20*c,h);

    outtextxy(150,60+20*c,f.name);

    itoa(f.price,pr,10);

    outtextxy(390,60+20*c,pr);

    }//END OF WHILE

    p1.close();

    settextstyle(15,0,1);

    outtextxy(30,325,"DO YOU WANT TO ADD AN

    ITEM - (Y/N)");

    gotoxy(60,20);

    cin>>ap;

    if(ap=='y'||ap=='Y')

    {

    app_fmenu();

    //CALLING APPEND FUNCTION

    }

    else

    {

  • 8/10/2019 Computer Investigatory Project(Hotel Management System)

    9/64

    ~ 8 ~

    if(ap=='n'||ap=='N')

    {

    outtextxy(30,360,"DO YOU WANT TODELETE ALL (Y/N)");

    char ch;

    gotoxy(60,23);

    cin>>ch;

    if(ch=='y'||ch=='Y')

    {

    del_all();

    //CALLING DELETE FUNCTION

    }

    }

    }

    }

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

    // FUNCTION TO APPEND IN FOOD MENU

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

  • 8/10/2019 Computer Investigatory Project(Hotel Management System)

    10/64

    ~ 9 ~

    void food::app_fmenu(void)

    {

    p1.open("food.txt",ios::app|ios::binary);

    outtextxy(30,360,"ENTER ITEM NAME U WANTTO

    ADD");

    gotoxy(60,23);

    gets(f.name);

    outtextxy(30,380,"ENTER THE PRICE");

    gotoxy(60,24);

    cin>>f.price;

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

    p1.close();

    getch();

    }

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

    // FUNCTION FOR FOOD BILL

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

  • 8/10/2019 Computer Investigatory Project(Hotel Management System)

    11/64

    ~ 10 ~

    void food::food_bill()

    {

    double bill=-1;

    char c_name[20],f_name[20];

    int dt;

    cleardevice();

    setfillstyle(7,1);

    floodfill(0,0,4);

    setfillstyle(7,10);

    bar(17,40,605,420);

    rectangle(17,40,605,420);

    setfillstyle(1,7);

    bar(24,47,598,413);

    rectangle(24,47,598,413);

    setcolor(4);

    settextstyle(7,0,1);

    outtextxy(30,70,"ENTER CUSTOMER NAME ");

    gotoxy(50,6);

  • 8/10/2019 Computer Investigatory Project(Hotel Management System)

    12/64

    ~ 11 ~

    cin>>c_name;

    outtextxy(30,120,"ENTER ITEM NAME TAKEN");

    gotoxy(50,9);

    cin>>f_name;

    outtextxy(30,170,"ENTER THE QUANTITY");

    gotoxy(50,12);

    cin>>dt;

    p1.close();

    p1.open("food.txt",ios::in|ios::binary);

    while(p1.read((char*)&f,sizeof(f)))

    {

    if(strcmp(f.name,f_name)==0)

    {

    bill=dt*f.price;

    }

    }//END OF WHILE

    if(bill==-1)

    {

    setcolor(1);

  • 8/10/2019 Computer Investigatory Project(Hotel Management System)

    13/64

    ~ 12 ~

    for(int i=0;i>cho;

    choose(cho);

    }while(cho!=3);//END OF WHILE

    }

    void choose(int a)

    {

    switch(a)

    {

  • 8/10/2019 Computer Investigatory Project(Hotel Management System)

    20/64

    ~ 19 ~

    case 1:

    {

    room_bill();

    break;

    }

    case 2:

    {

    j.food_bill();

    break;

    }

    case 3:

    break;

    }

    }

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

    // FUNCTION FOR ROOM BILL

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

  • 8/10/2019 Computer Investigatory Project(Hotel Management System)

    21/64

    ~ 20 ~

    void room_bill()

    {

    double bill;

    int days,no,dt,mth;

    cleardevice();

    setfillstyle(7,1);

    floodfill(0,0,4);

    setfillstyle(7,10);

    bar(17,40,605,420);

    rectangle(17,40,605,420);

    setfillstyle(1,7);

    bar(24,47,598,413);

    rectangle(24,47,598,413);

    setcolor(4);

    settextstyle(7,0,1);

    outtextxy(30,70,"ENTER CUSTOMER NO

    DEPARTING");

    gotoxy(50,6);

    cin>>no;

  • 8/10/2019 Computer Investigatory Project(Hotel Management System)

    22/64

  • 8/10/2019 Computer Investigatory Project(Hotel Management System)

    23/64

    ~ 22 ~

    }

    else

    {

    days=(mth-p.a_month)*30+(dt-p.a_date);

    }

    if(p.room_no