Advertisement
Tariqul_Islam

Hotel Management

Jul 12th, 2021
1,313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 34.59 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. string s;
  5. int deluxe =100;
  6. int atrium =200;
  7. int  business =300;
  8. int premier =400;
  9. int standard =500;
  10. int r,i,e,h,room1,age1,sum;
  11. char name1[20],residence1[20],cheakin1[20],cheakout1[20],number1[20];
  12.  
  13. struct node
  14. {
  15.     int room,age;
  16.     char name[20],number[20];
  17.     char residence[20];
  18.     char cheakin[20];
  19.     char cheakout[20];
  20.     int bill;
  21.     struct node *next;
  22. };
  23.  
  24. struct node *head1=NULL,*head2=NULL,*head3=NULL,*head4=NULL,*head5=NULL,*temp,*temp1,*s0,*s1,*s2,*s3,*s4,*cur,*pre;
  25.  
  26. void deluxe1();
  27. void premier1();
  28. void atrium1();
  29. void business1();
  30. void standard1();
  31. void dis_deluxe();
  32. void dis_atrium();
  33. void dis_business();
  34. void dis_premier();
  35. void dis_standard();
  36. void details();
  37. void book_atrium();
  38. void book_business();
  39. void book_duluxe();
  40. void book_premier();
  41. void book_standard();
  42. void display();
  43. void cancel();
  44. void start();
  45.  
  46.  
  47. int main()
  48. {
  49.  
  50.     while(1)
  51.     {
  52.         system("cls");
  53.         string keyword;
  54.         cout<<endl;
  55.         cout<<"                              *       *      * * * *     * * * * *    * * * *    *            "<<endl;
  56.         cout<<"                              *       *     *       *        *        *          *            "<<endl;
  57.         cout<<"                              * * * * *     *       *        *        * * * *    *            "<<endl;
  58.         cout<<"                              *       *     *       *        *        *          *            "<<endl;
  59.         cout<<"                              *       *      * * * *         *        * * * *    * * * *      "<<endl;
  60.         cout<<endl<<endl;
  61.  
  62.  
  63.         cout<<"     * * * *            **         * * * *       * * * * *       * * * *         * * * * *      *           *    "<<endl;
  64.         cout<<"     *       *         *  *        *        *        *          *        *      *         *     * *         *    "<<endl;
  65.         cout<<"     *       *        *    *       *        *        *          *               *         *     *   *       *    "<<endl;
  66.         cout<<"     * * * *         *  * * *      *        *        *           * * * *        *         *     *     *     *    "<<endl;
  67.         cout<<"     *  *           *        *     *        *        *                  *       *         *     *       *   *    "<<endl;
  68.         cout<<"     *     *       *          *    *       *         *         *        *       *         *     *         * *    "<<endl;
  69.         cout<<"     *        *   *            *   * * * *       * * * * *       * * * *         * * * * *      *           *    "<<endl;
  70.  
  71.         cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
  72.  
  73.         cout<<"If you want to ENTER into the project type  'enter'"<<endl<<endl;
  74.  
  75.         cout<<"If you want to close the project type 'close'"<<endl<<endl;
  76.  
  77.         cin>>s;
  78.  
  79.         if(s=="enter")
  80.         {
  81.             start();
  82.         }
  83.         else if(s=="close")
  84.         {
  85.             system("cls");
  86.             cout<<"                                       T H A N K S    F O R   U S I N G  O U R   S Y S T E M   "<<endl<<endl<<endl<<endl;
  87.             break;
  88.  
  89.         }
  90.     }
  91.     return 0;
  92. }
  93. void deluxe1()
  94. {
  95.     system("cls");
  96.     cout<<endl<<"DELUXE ROOMS: "<<endl<<endl;
  97.  
  98.     cout<<"SERVICES FOR DELUXE ROOMS:  "<<endl;
  99.     cout<<"Featuring one queen or two twin beds and three-piece bathrooms"<<endl;
  100.     cout<<"Guests can put final touches on projects at the work desk, enjoy a drink from the minibar, and relax in the plush armchair"<<endl;
  101.     cout<<"1. Electronic safe"<<endl;
  102.     cout<<"2. Free Wi-Fi"<<endl;
  103.     cout<<"3. Individual climate control"<<endl;
  104.     cout<<"4. Minibar and room service (available 24 hours)"<<endl;
  105.     cout<<"4. Phone with direct international dialing"<<endl<<endl<<endl;
  106.  
  107.     cout<<"You have to pay 4000 TK for one day and one night "<<endl<<endl<<endl;
  108.  
  109.     cout<<"If you want to book deluxe room type 'yes' otherwise 'no'"<<endl;
  110.     cin>>s;
  111.     getchar();
  112.     if(s=="yes")
  113.     {
  114.         book_duluxe();
  115.     }
  116.  
  117. }
  118.  
  119. void premier1()
  120. {
  121.     system("cls");
  122.     cout<<endl<<"PREMIER ROOMS: "<<endl<<endl;
  123.     cout<<"Our Premier Room makes for the perfect urban oasis with its great views, an ensuite bathroom and a well-equipped work area."<<endl;
  124.     cout<<"1.28 square meter large room"<<endl;
  125.     cout<<"2.Choice of king sized bed or twin beds"<<endl;
  126.     cout<<"3.Pool view or City view from the room"<<endl;
  127.     cout<<"4.Electronic safe"<<endl;
  128.     cout<<"5.Wired and wireless Internet access"<<endl;
  129.     cout<<"6.Ensuite bathroom with separate shower and long bathtub (in twin-bedded rooms)"<<endl;
  130.     cout<<"7.Executive writing table and stationery set."<<endl;
  131.     cout<<"8.32” LCD television with local and cable channel."<<endl;
  132.     cout<<"9.Fully stocked minibar."<<endl;
  133.     cout<<"10.Complimentary bottled water."<<endl;
  134.     cout<<"11.Daily newspaper."<<endl<<endl<<endl;
  135.  
  136.     cout<<"You have to pay 3000 TK for one day and one night "<<endl<<endl<<endl;
  137.  
  138.     cout<<"If you want to book premier room type 'yes' otherwise 'no'"<<endl;
  139.     cin>>s;
  140.     getchar();
  141.     if(s=="yes")
  142.     {
  143.         book_premier();
  144.     }
  145.  
  146.  
  147. }
  148.  
  149. void atrium1()
  150. {
  151.     system("cls");
  152.     cout<<endl<<"ATRIUM ROOMS"<<endl<<endl;
  153.  
  154.     cout<<"Atrium Rooms offer one king or two double beds, elegant linens and comfortable armchairs"<<endl;
  155.     cout<<"Free high-speed, wireless Internet so you can stay connected and productive"<<endl;
  156.     cout<<"1. Electronic safe"<<endl;
  157.     cout<<"2. Free Wi-Fi"<<endl;
  158.     cout<<"3. Individual climate control"<<endl;
  159.     cout<<"4. Minibar and room service (available 24 hours)"<<endl;
  160.     cout<<"4. Phone with direct international dialing"<<endl<<endl<<endl;
  161.  
  162.     cout<<"You have to pay 6000 TK for one day and one night "<<endl<<endl<<endl;
  163.  
  164.     cout<<"If you want to book atrium room type 'yes' otherwise 'no'"<<endl;
  165.     cin>>s;
  166.     getchar();
  167.     if(s=="yes")
  168.     {
  169.         book_atrium();
  170.     }
  171.  
  172.  
  173. }
  174.  
  175. void business1()
  176. {
  177.     system("cls");
  178.     cout<<endl<<"BUSINESS CLASS ROOMS"<<endl<<endl;
  179.  
  180.     cout<<"Corporate travelers love our Business Class Rooms"<<endl;
  181.  
  182.     cout<<"1. Electronic safe"<<endl;
  183.     cout<<"2. Free Wi-Fi"<<endl;
  184.     cout<<"3. Individual climate control"<<endl;
  185.     cout<<"4. Minibar and room service (available 24 hours)"<<endl;
  186.     cout<<"4. Phone with direct international dialing"<<endl<<endl<<endl;
  187.  
  188.     cout<<"ADDITIONAL BUSINESS CLASS AMENITIES"<<endl;
  189.     cout<<"Access to Business Class Lounge"<<endl;
  190.     cout<<"Airport transfer"<<endl;
  191.     cout<<"All-day refreshment in the Business Class Lounge"<<endl<<endl<<endl;
  192.  
  193.     cout<<"You have to pay 5000 TK for one day and one night "<<endl<<endl<<endl;
  194.  
  195.     cout<<"If you want to book business room type 'yes' otherwise 'no'"<<endl;
  196.     cin>>s;
  197.     getchar();
  198.     if(s=="yes")
  199.     {
  200.         book_business();
  201.     }
  202.  
  203. }
  204.  
  205. void standard1()
  206. {
  207.     system("cls");
  208.     cout<<endl<<"STANDARD ROOMS: "<<endl<<endl;
  209.     cout<<"Our comfortable Standard Room comes with city views and convenient amenities including cable television channels, to offer you a pleasant stay."<<endl;
  210.     cout<<"1.23 square meter large room"<<endl;
  211.     cout<<"2.Queen-sized Bed"<<endl;
  212.     cout<<"3.Executive writing table and stationery set."<<endl;
  213.     cout<<"4.Ensuite bathroom."<<endl;
  214.     cout<<"5.LCD television with local and cable channels."<<endl;
  215.     cout<<"6.Wired and wireless Internet access."<<endl;
  216.     cout<<"7.Secure key-card access."<<endl;
  217.     cout<<"8.Daily newspaper on request"<<endl<<endl<<endl;
  218.  
  219.     cout<<"You have to pay 4200 TK for one day and one night "<<endl<<endl<<endl;
  220.  
  221.     cout<<"If you want to book standard room type 'yes' otherwise 'no'"<<endl;
  222.     cin>>s;
  223.     getchar();
  224.     if(s=="yes")
  225.     {
  226.         book_standard();
  227.     }
  228.  
  229. }
  230.  
  231. void dis_deluxe()
  232. {
  233.  
  234.     temp1=head1;
  235.     if(head1==NULL)
  236.     {
  237.         cout<<"You haven't booked any deluxe room yet "<<endl;
  238.     }
  239.     else
  240.     {
  241.         cout<<endl<<"Here is the details of booked deluxe room"<<endl;
  242.         while(temp1!=NULL)
  243.         {
  244.             cout<<"Name of customer : "<<temp1->name<<endl;
  245.             cout<<"Age of customer : "<<temp1->age<<endl;
  246.             cout<<"Cheakin date of customer "<<temp1->cheakin<<endl;
  247.             cout<<"Cheakout date of customer "<<temp1->cheakout<<endl;
  248.             cout<<"Residence of cusstomer : "<<temp1->residence<<endl;
  249.             cout<<"Phone number of customer : "<<temp1->number<<endl;
  250.             cout<<"customer's booked deluxe room no is : "<<temp1->room<<endl<<endl;
  251.  
  252.             temp1=temp1->next;
  253.         }
  254.     }
  255. }
  256.  
  257. void dis_atrium()
  258. {
  259.  
  260.     temp=head2;
  261.     if(head2==NULL)
  262.     {
  263.         cout<<"You haven't booked any atrium room yet "<<endl;
  264.     }
  265.     else
  266.     {
  267.         cout<<endl<<"Here is the details of booked atrium room"<<endl;
  268.         while(temp!=NULL)
  269.         {
  270.             cout<<"Name of customer : "<<temp->name<<endl;
  271.             cout<<"Age of customer : "<<temp->age<<endl;
  272.             cout<<"Cheakin date of customer "<<temp->cheakin<<endl;
  273.             cout<<"Cheakout date of customer "<<temp->cheakout<<endl;
  274.             cout<<"Residence of cusstomer : "<<temp->residence<<endl;
  275.             cout<<"Phone number of customer : "<<temp->number<<endl;
  276.             cout<<"customer's booked atrium room no is : ";
  277.             cout<<temp->room<<"."<<endl;
  278.  
  279.             temp=temp->next;
  280.         }
  281.     }
  282. }
  283.  
  284. void dis_business()
  285. {
  286.  
  287.     temp=head3;
  288.     if(head3==NULL)
  289.     {
  290.         cout<<"You haven't booked any business room yet "<<endl;
  291.     }
  292.     else
  293.     {
  294.         cout<<endl<<"Here is the details of booked business class room"<<endl;
  295.         while(temp!=NULL)
  296.         {
  297.             cout<<"Name of customer : "<<temp->name<<endl;
  298.             cout<<"Age of customer : "<<temp->age<<endl;
  299.             cout<<"Cheakin date of customer "<<temp->cheakin<<endl;
  300.             cout<<"Cheakout date of customer "<<temp->cheakout<<endl;
  301.             cout<<"Residence of cusstomer : "<<temp->residence<<endl;
  302.             cout<<"Phone number of customer : "<<temp->number<<endl;
  303.             cout<<"customer's booked business room no is : ";
  304.             cout<<temp->room<<"."<<endl;
  305.             temp=temp->next;
  306.         }
  307.     }
  308. }
  309. void dis_premier()
  310. {
  311.  
  312.     temp=head4;
  313.     if(head4==NULL)
  314.     {
  315.         cout<<"You haven't booked any premier room yet "<<endl;
  316.     }
  317.     else
  318.     {
  319.         cout<<endl<<"Here is the details of booked premier room"<<endl;
  320.         while(temp!=NULL)
  321.         {
  322.             cout<<"Name of customer : "<<temp->name<<endl;
  323.             cout<<"Age of customer : "<<temp->age<<endl;
  324.             cout<<"Cheakin date of customer "<<temp->cheakin<<endl;
  325.             cout<<"Cheakout date of customer "<<temp->cheakout<<endl;
  326.             cout<<"Residence of cusstomer : "<<temp->residence<<endl;
  327.             cout<<"Phone number of customer : "<<temp->number<<endl;
  328.             cout<<"customer's booked premier room no is : ";
  329.             cout<<temp->room<<"."<<endl;
  330.             temp=temp->next;
  331.         }
  332.     }
  333. }
  334. void dis_standard()
  335. {
  336.  
  337.     temp=head5;
  338.     if(head5==NULL)
  339.     {
  340.         cout<<"You haven't booked any standard room yet "<<endl;
  341.     }
  342.     else
  343.     {
  344.         cout<<endl<<"Here is the details of booked standard room"<<endl;
  345.         while(temp!=NULL)
  346.         {
  347.             cout<<"Name of customer : "<<temp->name<<endl;
  348.             cout<<"Age of customer : "<<temp->age<<endl;
  349.             cout<<"Cheakin date of customer "<<temp->cheakin<<endl;
  350.             cout<<"Cheakout date of customer "<<temp->cheakout<<endl;
  351.             cout<<"Residence of customer : "<<temp->residence<<endl;
  352.             cout<<"Phone number of customer : "<<temp->number<<endl;
  353.             cout<<"your booked standard room no is : ";
  354.             cout<<temp->room<<"."<<endl;
  355.             temp=temp->next;
  356.         }
  357.     }
  358. }
  359.  
  360. void details()
  361. {
  362.     system("cls");
  363.     while(1)
  364.     {
  365.         system("cls");
  366.         cout<<"Which room's details you want to see"<<endl<<endl;
  367.         string room;
  368.         cout<<"    For DELEUXE room type 'deluxe'"<<endl;
  369.         cout<<"    For ATRIUM room type 'atrium'"<<endl;
  370.         cout<<"    For BUSINESS CLASS room type 'business'"<<endl;
  371.         cout<<"    For PREMIER room type 'premier'"<<endl;
  372.         cout<<"    For STANDARD room type 'standard'"<<endl<<endl<<endl;
  373.  
  374.         cout<<"If you want to go back to the previous page type 'back'"<<endl;
  375.  
  376.  
  377.         cin>>room;
  378.  
  379.         if(room=="deluxe")
  380.         {
  381.             deluxe1();
  382.         }
  383.         else if(room=="atrium")
  384.         {
  385.             atrium1();
  386.         }
  387.         else if(room=="business")
  388.         {
  389.             business1();
  390.         }
  391.         else if(room=="premier")
  392.         {
  393.             premier1();
  394.         }
  395.         else if(room=="standard")
  396.         {
  397.             standard1();
  398.         }
  399.         else if(room=="back")
  400.         {
  401.             break;
  402.         }
  403.         else
  404.         {
  405.             system("cls");
  406.             cout<<"You entered a wrong keyword...please try again"<<endl;
  407.             continue;
  408.         }
  409.         system("cls");
  410. s:
  411.         cout<<endl<<"If you want to see more details about room type 'yes' otherwise type 'no'"<<endl;
  412.         cin>>s;
  413.         if(s=="yes")
  414.         {
  415.             continue;
  416.         }
  417.         else if(s=="no")
  418.         {
  419.             break;
  420.         }
  421.         else
  422.         {
  423.             system("cls");
  424.             cout<<"Sorry you entered a wrong keyword...please try again"<<endl;
  425.             goto s;
  426.         }
  427.  
  428.     }
  429.  
  430. }
  431.  
  432. void book_duluxe()
  433. {
  434.     system("cls");
  435.  
  436.     sum=0;
  437.  
  438.     cout<<"Enter your name"<<endl;
  439.     fgets(name1,20,stdin);
  440.     cout<<"Enter your residence"<<endl;
  441.     fgets(residence1,20,stdin);
  442.  
  443.  
  444.     cout<<"Enter cheakin Date"<<endl;
  445.     fgets(cheakin1,20,stdin);
  446.  
  447.     cout<<"Enter cheakout Date"<<endl;
  448.     fgets(cheakout1,20,stdin);
  449.  
  450.     cout<<"Enter your number"<<endl;
  451.     fgets(number1,20,stdin);
  452.  
  453.  
  454.     cout<<"Enter How many days you want to stay"<<endl;
  455.     cin>>e;
  456.  
  457.     cout<<"Enter how many room you want to book"<<endl;
  458.     cin>>r;
  459.  
  460.     cout<<"Enter your Age"<<endl;
  461.     cin>>age1;
  462.  
  463.     system("cls");
  464.  
  465.     cout<<endl<<"Congratulations!!!"<<endl<<endl;
  466.     cout<<"You have successfully booked "<<r<<" deluxe room"<<endl;
  467.  
  468.     for(i=1; i<=r; i++)
  469.     {
  470.         struct node *newnode;
  471.         newnode=(struct node*)malloc(sizeof(struct node));
  472.  
  473.         strcpy(newnode->name,name1);
  474.  
  475.         strcpy(newnode->number,number1);
  476.         newnode->age=age1;
  477.         strcpy(newnode->residence,residence1);
  478.         strcpy(newnode->cheakin,cheakin1);
  479.         strcpy(newnode->cheakout,cheakout1);
  480.  
  481.         sum+=4000;
  482.  
  483.         deluxe++;
  484.         newnode->room=deluxe;
  485.         cout<<"Your booked room number "<<deluxe<<"."<<endl;
  486.  
  487.         if(head1==NULL)
  488.         {
  489.             head1=newnode;
  490.             head1->next=NULL;
  491.             s0=head1;
  492.         }
  493.         else
  494.         {
  495.             s0->next=newnode;
  496.             s0=newnode;
  497.             s0->next=NULL;
  498.         }
  499.     }
  500.     cout<<endl;
  501.     cout<<name1<<" have to pay "<<sum<<" taka without tax"<<endl;
  502.     cout<<name1<<" have also to pay 10% tax = "<<(10*sum)/100<<" taka";
  503.  
  504.     cout<<endl<<name1<<" have to pay all total(with tax) "<<sum+(10*sum/100)<<" taka"<<endl;
  505.  
  506.     cout<<endl<<"Type 'ok' to continue"<<endl;
  507.     cin>>s;
  508.  
  509. }
  510.  
  511. void book_atrium()
  512. {
  513.     system("cls");
  514.  
  515.     sum=0;
  516.  
  517.     cout<<"Enter your name"<<endl;
  518.     fgets(name1,20,stdin);
  519.     cout<<"Enter your residence"<<endl;
  520.     fgets(residence1,20,stdin);
  521.  
  522.  
  523.     cout<<"Enter cheakin Date"<<endl;
  524.     fgets(cheakin1,20,stdin);
  525.  
  526.     cout<<"Enter cheakout Date"<<endl;
  527.     fgets(cheakout1,20,stdin);
  528.  
  529.     cout<<"Enter your number"<<endl;
  530.     fgets(number1,20,stdin);
  531.  
  532.  
  533.     cout<<"Enter How many days you want to stay"<<endl;
  534.     cin>>e;
  535.  
  536.     cout<<"Enter how many room you want to book"<<endl;
  537.     cin>>r;
  538.  
  539.     cout<<"Enter your Age"<<endl;
  540.     cin>>age1;
  541.  
  542.     system("cls");
  543.  
  544.     cout<<endl<<"Congratulations!!!"<<endl<<endl;
  545.     cout<<"You have successfully booked "<<r<<" deluxe room"<<endl;
  546.  
  547.     for(i=1; i<=r; i++)
  548.     {
  549.         struct node *newnode;
  550.         newnode=(struct node*)malloc(sizeof(struct node));
  551.  
  552.         strcpy(newnode->name,name1);
  553.  
  554.         strcpy(newnode->number,number1);
  555.         newnode->age=age1;
  556.         strcpy(newnode->residence,residence1);
  557.         strcpy(newnode->cheakin,cheakin1);
  558.         strcpy(newnode->cheakout,cheakout1);
  559.         atrium++;
  560.         newnode->room=atrium;
  561.         cout<<"Your booked atrium room number "<< newnode->room<<"."<<endl<<endl;
  562.  
  563.         sum+=6000;
  564.  
  565.         newnode->next=NULL;
  566.         if(head2==NULL)
  567.         {
  568.             head2=newnode;
  569.             s1=head2;
  570.         }
  571.         else
  572.         {
  573.             s1->next=newnode;
  574.             s1=newnode;
  575.         }
  576.     }
  577.     cout<<name1<<" have to pay "<<sum<<" taka"<<endl;
  578.  
  579.     cout<<name1<<" have also to pay 10% tax = "<<(10*sum)/100<<" taka";
  580.  
  581.     cout<<endl<<name1<<" have to pay all total(with tax) "<<sum+(10*sum/100)<<" taka"<<endl;
  582.  
  583.     cout<<endl<<"Type ok to continue"<<endl;
  584.     cin>>s;
  585.  
  586. }
  587.  
  588. void book_business()
  589. {
  590.     system("cls");
  591.  
  592.     sum=0;
  593.  
  594.     cout<<"Enter your name"<<endl;
  595.     fgets(name1,20,stdin);
  596.     cout<<"Enter your residence"<<endl;
  597.     fgets(residence1,20,stdin);
  598.  
  599.  
  600.     cout<<"Enter cheakin Date"<<endl;
  601.     fgets(cheakin1,20,stdin);
  602.  
  603.     cout<<"Enter cheakout Date"<<endl;
  604.     fgets(cheakout1,20,stdin);
  605.  
  606.     cout<<"Enter your number"<<endl;
  607.     fgets(number1,20,stdin);
  608.  
  609.  
  610.     cout<<"Enter How many days you want to stay"<<endl;
  611.     cin>>e;
  612.  
  613.     cout<<"Enter how many room you want to book"<<endl;
  614.     cin>>r;
  615.  
  616.     cout<<"Enter your Age"<<endl;
  617.     cin>>age1;
  618.  
  619.     system("cls");
  620.  
  621.     cout<<endl<<"Congratulations!!!"<<endl<<endl;
  622.     cout<<"You have successfully booked "<<r<<" deluxe room"<<endl;
  623.  
  624.     for(i=1; i<=r; i++)
  625.     {
  626.         struct node *newnode;
  627.         newnode=(struct node*)malloc(sizeof(struct node));
  628.  
  629.         strcpy(newnode->name,name1);
  630.  
  631.         strcpy(newnode->number,number1);
  632.         newnode->age=age1;
  633.         strcpy(newnode->residence,residence1);
  634.         strcpy(newnode->cheakin,cheakin1);
  635.         strcpy(newnode->cheakout,cheakout1);
  636.  
  637.         sum+=5000;
  638.  
  639.         business++;
  640.         cout<<"Your booked business room number "<<business<<"."<<endl<<endl;
  641.         newnode->room=business;
  642.         newnode->next=NULL;
  643.         if(head3==NULL)
  644.         {
  645.             head3=newnode;
  646.             s2=head3;
  647.         }
  648.         else
  649.         {
  650.             s2->next=newnode;
  651.             s2=newnode;
  652.         }
  653.     }
  654.  
  655.     cout<<endl<<name1<<" have to pay "<<sum<<" taka"<<endl;
  656.     cout<<name1<<" have also to pay 10% tax = "<<(10*sum)/100<<" taka";
  657.  
  658.     cout<<endl<<name1<<" have to pay all total(with tax) "<<sum+(10*sum/100)<<" taka"<<endl;
  659.  
  660.  
  661.     cout<<endl<<endl<<"Type ok to continue"<<endl;
  662.     cin>>s;
  663.  
  664. }
  665.  
  666. void book_premier()
  667. {
  668.     system("cls");
  669.  
  670.     sum=0;
  671.  
  672.     cout<<"Enter your name"<<endl;
  673.     fgets(name1,20,stdin);
  674.     cout<<"Enter your residence"<<endl;
  675.     fgets(residence1,20,stdin);
  676.  
  677.  
  678.     cout<<"Enter cheakin Date"<<endl;
  679.     fgets(cheakin1,20,stdin);
  680.  
  681.     cout<<"Enter cheakout Date"<<endl;
  682.     fgets(cheakout1,20,stdin);
  683.  
  684.     cout<<"Enter your number"<<endl;
  685.     fgets(number1,20,stdin);
  686.  
  687.  
  688.     cout<<"Enter How many days you want to stay"<<endl;
  689.     cin>>e;
  690.  
  691.     cout<<"Enter how many room you want to book"<<endl;
  692.     cin>>r;
  693.  
  694.     cout<<"Enter your Age"<<endl;
  695.     cin>>age1;
  696.  
  697.     system("cls");
  698.  
  699.     cout<<endl<<"Congratulations!!!"<<endl<<endl;
  700.     cout<<"You have successfully booked "<<r<<" deluxe room"<<endl;
  701.  
  702.  
  703.     for(i=1; i<=r; i++)
  704.     {
  705.  
  706.         struct node *newnode;
  707.         newnode=(struct node*)malloc(sizeof(struct node));
  708.  
  709.         strcpy(newnode->name,name1);
  710.  
  711.         strcpy(newnode->number,number1);
  712.         newnode->age=age1;
  713.         strcpy(newnode->residence,residence1);
  714.         strcpy(newnode->cheakin,cheakin1);
  715.         strcpy(newnode->cheakout,cheakout1);
  716.  
  717.         sum+=3000;
  718.         premier++;
  719.         cout<<"Your booked premier room number "<<premier<<"."<<endl;
  720.         newnode->next=NULL;
  721.         newnode->room=premier;
  722.  
  723.         if(head4==NULL)
  724.         {
  725.             head4=newnode;
  726.             s3=head4;
  727.         }
  728.         else
  729.         {
  730.             s3->next=newnode;
  731.             s3=newnode;
  732.         }
  733.     }
  734.     cout<<name1<<" have to pay "<<sum<<" taka"<<endl;
  735.     cout<<name1<<" have also to pay 10% tax = "<<(10*sum)/100<<" taka";
  736.  
  737.     cout<<endl<<name1<<" have to pay all total(with tax) "<<sum+(10*sum/100)<<" taka"<<endl;
  738.  
  739.     cout<<endl<<"Type ok to continue"<<endl;
  740.     cin>>s;
  741. }
  742.  
  743. void book_standard()
  744. {
  745.     system("cls");
  746.     sum=0;
  747.  
  748.     cout<<"Enter your name"<<endl;
  749.     fgets(name1,20,stdin);
  750.     cout<<"Enter your residence"<<endl;
  751.     fgets(residence1,20,stdin);
  752.  
  753.  
  754.     cout<<"Enter cheakin Date"<<endl;
  755.     fgets(cheakin1,20,stdin);
  756.  
  757.     cout<<"Enter cheakout Date"<<endl;
  758.     fgets(cheakout1,20,stdin);
  759.  
  760.     cout<<"Enter your number"<<endl;
  761.     fgets(number1,20,stdin);
  762.  
  763.  
  764.     cout<<"Enter How many days you want to stay"<<endl;
  765.     cin>>e;
  766.  
  767.     cout<<"Enter how many room you want to book"<<endl;
  768.     cin>>r;
  769.  
  770.     cout<<"Enter your Age"<<endl;
  771.     cin>>age1;
  772.  
  773.     system("cls");
  774.  
  775.     cout<<endl<<"Congratulations!!!"<<endl<<endl;
  776.     cout<<"You have successfully booked "<<r<<" deluxe room"<<endl;
  777.  
  778.  
  779.     for(i=1; i<=r; i++)
  780.     {
  781.         struct node *newnode;
  782.         newnode=(struct node*)malloc(sizeof(struct node));
  783.  
  784.         strcpy(newnode->name,name1);
  785.  
  786.         strcpy(newnode->number,number1);
  787.         newnode->age=age1;
  788.         strcpy(newnode->residence,residence1);
  789.         strcpy(newnode->cheakin,cheakin1);
  790.         strcpy(newnode->cheakout,cheakout1);
  791.  
  792.         sum+=4200;
  793.  
  794.         standard++;
  795.         newnode->room=standard;
  796.         cout<<"Your booked room number "<<standard<<"."<<endl<<endl;
  797.  
  798.         newnode->next=NULL;
  799.  
  800.         if(head5==NULL)
  801.         {
  802.             head5=newnode;
  803.             s4=head5;
  804.         }
  805.         else
  806.         {
  807.             s4->next=newnode;
  808.             s4=newnode;
  809.         }
  810.     }
  811.     cout<<name1<<" have to pay "<<sum<<" taka"<<endl;
  812.     cout<<name1<<" have also to pay 10% tax = "<<(10*sum)/100<<" taka";
  813.  
  814.     cout<<endl<<name1<<" have to pay all total(with tax) "<<sum+(10*sum/100)<<" taka"<<endl;
  815.  
  816.     cout<<endl<<"Type ok to continue"<<endl;
  817.     cin>>s;
  818. }
  819.  
  820. void book()
  821. {
  822.  
  823.     while(1)
  824.  
  825.     {
  826.         system("cls");
  827.         cout<<"     For Booking DELUXE ROOMS type 'deluxe'"<<endl;
  828.         cout<<"     For Booking  ATRIUM ROOMS type 'atrium' "<<endl;
  829.         cout<<"     For Booking BUSINESS CLASS ROOMS 'business' "<<endl;
  830.         cout<<"     For Booking  PREMIER ROOMS type 'premier' "<<endl;
  831.         cout<<"     For Booking  STANDARD ROOMS type 'standard' "<<endl;
  832.  
  833.         cout<<"If you want to go back to the previous page type 'back'"<<endl;
  834.  
  835.         string x;
  836.         cin>>x;
  837.         getchar();
  838.  
  839.         if(x=="deluxe")
  840.         {
  841.             book_duluxe();
  842.         }
  843.         else if(x=="atrium")
  844.         {
  845.             book_atrium();
  846.         }
  847.         else if(x=="business")
  848.         {
  849.             book_business();
  850.         }
  851.         else if(x=="premier")
  852.         {
  853.             book_premier();
  854.         }
  855.         else if(x=="standard")
  856.         {
  857.             book_standard();
  858.         }
  859.         else if(x=="back")
  860.         {
  861.             break;
  862.         }
  863.         else
  864.         {
  865.             system("cls");
  866.             cout<<"You entered a wrong keyword...please try again"<<endl;
  867.             continue;
  868.         }
  869. bok:
  870.         system("cls");
  871.         cout<<endl<<"If you want to book more rooms type 'yes' otherwise 'no'"<<endl;
  872.         cin>>s;
  873.         if(s=="yes")
  874.         {
  875.             continue;
  876.         }
  877.         else if(s=="no")
  878.         {
  879.             break;
  880.         }
  881.         else
  882.         {
  883.             system("cls");
  884.             cout<<"You entered a wrong keyword please try again"<<endl;
  885.             goto bok;
  886.         }
  887.  
  888.  
  889.     }
  890.  
  891.  
  892. }
  893.  
  894. void cancel()
  895. {
  896.     while(1)
  897.     {
  898.         system("cls");
  899.         cout<<"Here is the details of your booked room list"<<endl;
  900.         dis_atrium();
  901.         dis_business();
  902.         dis_deluxe();
  903.         dis_standard();
  904.         dis_premier();
  905.  
  906.         cout<<endl<<endl<<"Which Room reservation you want to delete"<<endl<<endl;
  907.  
  908.         cout<<"      For deleting reservation of DELUXE ROOMS type 'deluxe' "<<endl;
  909.         cout<<"      For deleting reservation of  ATRIUM ROOMS type 'atrium'"<<endl;
  910.         cout<<"      For deleting reservation of BUSINESS CLASS ROOMS type 'business'"<<endl;
  911.         cout<<"      For deleting reservation of  PREMIER ROOMS type 'premier' "<<endl;
  912.         cout<<"      For deleting reservation of  STANDARD ROOMS type 'standard'"<<endl<<endl<<endl;
  913.  
  914.         cout<<"If you want to go back to the previous page type 'back'"<<endl;
  915.  
  916.         string y;
  917.         cin>>y;
  918.  
  919.         if(y=="deluxe")
  920.         {
  921.             pre=head1;
  922.             cur=head1->next;
  923.             cout<<"Enter a number which you want to delete deluxe room number"<<endl;
  924.             cin>>h;
  925.             if(head1==NULL)
  926.             {
  927.                 system("cls");
  928.                 cout<<endl<<"sorry you have not any reservation"<<endl<<endl;
  929.             }
  930.  
  931.             else if(h==pre->room)
  932.             {
  933.                 head1=cur;
  934.                 cout<<"Thank you!!!"<<endl<<endl;
  935.                 cout<<"Your resevation of deluxe room no "<<h<<" was cancelled"<<endl<<endl;
  936.                 delete(pre);
  937.             }
  938.             else
  939.             {
  940.                 while(cur->room!=h && cur->next!=NULL)
  941.                 {
  942.                     pre=cur;
  943.                     cur=cur->next;
  944.  
  945.                 }
  946.                 if(cur->room==h)
  947.                 {
  948.                     pre->next=cur->next;
  949.                     delete(cur);
  950.                     cout<<"Thank you!!!"<<endl<<endl;
  951.                     cout<<"Your resevation of deluxe room no "<<h<<" was cancelled"<<endl<<endl;
  952.                 }
  953.                 else
  954.                 {
  955.                     cout<<"Data was not found"<<endl;
  956.                 }
  957.             }
  958.         }
  959.         else if(y=="atrium")
  960.         {
  961.             pre=head2;
  962.             cur=head2->next;
  963.             cout<<"Enter a number which you want to delete atrium room number"<<endl;
  964.             cin>>h;
  965.             if(head2==NULL)
  966.             {
  967.                 system("cls");
  968.                 cout<<endl<<"sorry you have not any reservation"<<endl<<endl;
  969.             }
  970.  
  971.             else if(h==pre->room)
  972.             {
  973.                 head2=cur;
  974.                 cout<<"Thank you!!!"<<endl<<endl;
  975.                 cout<<"Your resevation of atrium room no "<<h<<" was cancelled"<<endl<<endl;
  976.                 delete(pre);
  977.             }
  978.             else
  979.             {
  980.                 while(cur->room!=h && cur->next!=NULL)
  981.                 {
  982.                     pre=cur;
  983.                     cur=cur->next;
  984.  
  985.                 }
  986.                 if(cur->room==h)
  987.                 {
  988.                     pre->next=cur->next;
  989.                     delete(cur);
  990.                     cout<<"Thank you!!!"<<endl<<endl;
  991.                     cout<<"Your resevation of deluxe room no "<<h<<" was cancelled"<<endl<<endl;
  992.                 }
  993.                 else
  994.                 {
  995.                     cout<<"Data was not found"<<endl;
  996.                 }
  997.             }
  998.         }
  999.         else if(y=="business")
  1000.         {
  1001.             pre=head3;
  1002.             cur=head3->next;
  1003.             cout<<"Enter a number which you want to delete business room number"<<endl;
  1004.             cin>>h;
  1005.             if(head3==NULL)
  1006.             {
  1007.                 system("cls");
  1008.                 cout<<endl<<"sorry you have not any reservation"<<endl<<endl;
  1009.             }
  1010.  
  1011.             else if(h==pre->room)
  1012.             {
  1013.                 head3=cur;
  1014.                 cout<<"Thank you!!!"<<endl<<endl;
  1015.                 cout<<"Your resevation of business room no "<<h<<" was cancelled"<<endl<<endl;
  1016.                 delete(pre);
  1017.             }
  1018.             else
  1019.             {
  1020.                 while(cur->room!=h && cur->next!=NULL)
  1021.                 {
  1022.                     pre=cur;
  1023.                     cur=cur->next;
  1024.  
  1025.                 }
  1026.                 if(cur->room==h)
  1027.                 {
  1028.                     pre->next=cur->next;
  1029.                     delete(cur);
  1030.                     cout<<"Thank you!!!"<<endl<<endl;
  1031.                     cout<<"Your resevation of business room no "<<h<<" was cancelled"<<endl<<endl;
  1032.                 }
  1033.                 else
  1034.                 {
  1035.                     cout<<"Data was not found"<<endl;
  1036.                 }
  1037.             }
  1038.         }
  1039.         else if(y=="premier")
  1040.         {
  1041.             pre=head4;
  1042.             cur=head4->next;
  1043.             cout<<"Enter a number which you want to delete premier room number"<<endl;
  1044.             cin>>h;
  1045.             if(head4==NULL)
  1046.             {
  1047.                 system("cls");
  1048.                 cout<<endl<<"sorry you have not any reservation"<<endl<<endl;
  1049.             }
  1050.  
  1051.             else if(h==pre->room)
  1052.             {
  1053.                 head4=cur;
  1054.                 cout<<"Thank you!!!"<<endl<<endl;
  1055.                 cout<<"Your resevation of premier room no "<<h<<" was cancelled"<<endl<<endl;
  1056.                 delete(pre);
  1057.             }
  1058.             else
  1059.             {
  1060.                 while(cur->room!=h && cur->next!=NULL)
  1061.                 {
  1062.                     pre=cur;
  1063.                     cur=cur->next;
  1064.  
  1065.                 }
  1066.                 if(cur->room==h)
  1067.                 {
  1068.                     pre->next=cur->next;
  1069.                     delete(cur);
  1070.                     cout<<"Thank you!!!"<<endl<<endl;
  1071.                     cout<<"Your resevation of premier room no "<<h<<" was cancelled"<<endl<<endl;
  1072.                 }
  1073.                 else
  1074.                 {
  1075.                     cout<<"Data was not found"<<endl;
  1076.                 }
  1077.             }
  1078.         }
  1079.         else if(y=="standard")
  1080.         {
  1081.             pre=head5;
  1082.             cur=head5->next;
  1083.             cout<<"Enter a number which you want to delete standard room number"<<endl;
  1084.             cin>>h;
  1085.             if(head5==NULL)
  1086.             {
  1087.                 system("cls");
  1088.                 cout<<endl<<"sorry you have not any reservation"<<endl<<endl;
  1089.             }
  1090.  
  1091.             else if(h==pre->room)
  1092.             {
  1093.                 head5=cur;
  1094.                 cout<<"Thank you!!!"<<endl<<endl;
  1095.                 cout<<"Your resevation of standard room no "<<h<<" was cancelled"<<endl<<endl;
  1096.                 delete(pre);
  1097.             }
  1098.             else
  1099.             {
  1100.                 while(cur->room!=h && cur->next!=NULL)
  1101.                 {
  1102.                     pre=cur;
  1103.                     cur=cur->next;
  1104.  
  1105.                 }
  1106.                 if(cur->room==h)
  1107.                 {
  1108.                     pre->next=cur->next;
  1109.                     delete(cur);
  1110.                     cout<<"Thank you!!!"<<endl<<endl;
  1111.                     cout<<"Your resevation of standard room no "<<h<<" was cancelled"<<endl<<endl;
  1112.                 }
  1113.                 else
  1114.                 {
  1115.                     cout<<"Data was not found"<<endl;
  1116.                 }
  1117.             }
  1118.         }
  1119.         else if(y=="back")
  1120.         {
  1121.             break;
  1122.         }
  1123.         else
  1124.         {
  1125.             system("cls");
  1126.             cout<<"Sorry you type a wron keyword...please try agian"<<endl;
  1127.             continue;
  1128.         }
  1129. can:
  1130.         cout<<"If you want to cancel more rooms reservation type 'yes' otherwiae 'no' "<<endl;
  1131.         cin>>s;
  1132.         if(s=="yes")
  1133.         {
  1134.             continue;
  1135.         }
  1136.         else if(s=="no")
  1137.         {
  1138.             break;
  1139.         }
  1140.         else
  1141.         {
  1142.             system("cls");
  1143.             cout<<"Sorry you entered a wrong keyword "<<endl;
  1144.             goto can;
  1145.         }
  1146.     }
  1147. }
  1148.  
  1149. void display()
  1150. {
  1151.     while(1)
  1152.     {
  1153.         system("cls");
  1154.  
  1155.         cout<<"    For watching deluxe booked room list type 'deluxe' "<<endl;
  1156.         cout<<"    For watching atrium booked room list type 'atrium' "<<endl;
  1157.         cout<<"    For watching premier booked room list type 'premier' "<<endl;
  1158.         cout<<"    For watching business class booked room list type 'business' "<<endl;
  1159.         cout<<"    For watching standard booked room list type 'standard' "<<endl<<endl<<endl;
  1160.  
  1161.         cout<<"If you want to go back to the previous page type 'back'"<<endl;
  1162.  
  1163.         cin>>s;
  1164.         if(s=="deluxe")
  1165.         {
  1166.             dis_deluxe();
  1167.         }
  1168.         else if(s=="atrium")
  1169.         {
  1170.             dis_atrium();
  1171.         }
  1172.         else if(s=="premier")
  1173.         {
  1174.             dis_premier();
  1175.         }
  1176.         else if(s=="business")
  1177.         {
  1178.             dis_business();
  1179.         }
  1180.         else if(s=="standard")
  1181.         {
  1182.             dis_standard();
  1183.         }
  1184.         else if(s=="back")
  1185.         {
  1186.             break;
  1187.         }
  1188.         else
  1189.         {
  1190.             system("cls");
  1191.             cout<<"You entered a wrong keyword"<<endl;
  1192.             continue;
  1193.         }
  1194. dis:
  1195.         cout<<"If you want to see more booked room's details type 'yes' otherwise 'no'"<<endl;
  1196.         cin>>s;
  1197.         if(s=="yes")
  1198.         {
  1199.             continue;
  1200.         }
  1201.         else if(s=="no")
  1202.         {
  1203.             break;
  1204.         }
  1205.         else
  1206.         {
  1207.             system("cls");
  1208.             cout<<"you entered a wrong keyword..please try again"<<endl;
  1209.             goto dis;
  1210.         }
  1211.  
  1212.     }
  1213. }
  1214.  
  1215. void start()
  1216. {
  1217.     while(1)
  1218.     {
  1219.         system("cls");
  1220.         cout<<"Control Panel"<<endl<<endl;
  1221.  
  1222.         cout<<"If you want to see the details of room type 'details'"<<endl;
  1223.         cout<<"If you want to book room type 'book'"<<endl;
  1224.         cout<<"For cancel any reservation type 'cancel'"<<endl;
  1225.         cout<<"For watching the booked room list of customer type 'show' "<<endl<<endl<<endl<<endl;
  1226.         cout<<"If you want to go to homepage type 'homepage'"<<endl;
  1227.  
  1228.  
  1229.         cin>>s;
  1230.         if(s=="details")
  1231.         {
  1232.             details();
  1233.         }
  1234.         else if(s=="book")
  1235.         {
  1236.             book();
  1237.         }
  1238.         else if(s=="cancel")
  1239.         {
  1240.             cancel();
  1241.         }
  1242.         else if(s=="show")
  1243.         {
  1244.             display();
  1245.         }
  1246.         else if(s=="homepage")
  1247.         {
  1248.             int main();
  1249.  
  1250.             break;
  1251.         }
  1252.         else
  1253.         {
  1254.             system("cls");
  1255.  
  1256.             cout<<"You entered a wrong keyword...please try again..type 'ok' to continue"<<endl;
  1257.             cin>>s;
  1258.  
  1259.         }
  1260.  
  1261.     }
  1262. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement