Advertisement
Guest User

hotel booking

a guest
Sep 21st, 2017
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 42.00 KB | None | 0 0
  1. #include<iostream.h>
  2. #include<graphics.h>
  3. #include<conio.h>
  4. #include<dos.h>
  5. #include<string.h>
  6. #include<fstream.h>
  7. #include<process.h>
  8. #include<stdlib.h>
  9. #include<stdio.h>
  10. #include<ctype.h>
  11.  
  12. class menu
  13. {
  14.     public:
  15.         void main_menu(void);
  16.         void help(void);
  17.         void enter_password(void);
  18.         void graphics_function(void);
  19.         void circle_function(void);
  20. //      void certificate(void);
  21.         void acknowledgement(void);
  22.         void introduction();
  23.         void references(void);
  24.         void display(void);
  25.         void close_function(void);
  26.         void line_hor(int, int, int, char);
  27.         void line_ver(int, int, int, char);
  28.     private:
  29.         void edit_menu(void);
  30.         void report_menu(void);
  31.         void room_edit_menu(void);
  32.         void customer_edit_menu(void);
  33.         void box_password(void);
  34.         void box_menu(void);
  35. };
  36.  
  37. class room
  38. {
  39.     public:
  40.         void add(void);
  41.         void modify(void);
  42.         void deletion(void);
  43.         void display_room_record(void);
  44.         void display_list(void);
  45.         int room_found(int);
  46.         void change_status(int,char);
  47.         char room_status(int);
  48.         float get_data(int);
  49.     private:
  50.         int recordno(int);
  51.         void display_record(int);
  52.         int roomno;
  53.         char roomcode[5], status;
  54.         float tarriff;
  55. };
  56.  
  57. class customer
  58. {
  59.     public:
  60.         void checkin(void);
  61.         void checkout(void);
  62.         void modify(void);
  63.         void deletion(void);
  64.         void display_list(void);
  65.         void display_customer_record(void);
  66.     private:
  67.         int recordno(int);
  68.         void display_record(int);
  69.         void delete_record(int);
  70.         int roomno;
  71.         char name[21], phone[8];
  72.         float advance, misc, room_srv;
  73. };
  74.  
  75. class account
  76. {
  77.     public:
  78.     void prepare_bill(int, float, char t_name[21], float, float, float);
  79. };
  80.  
  81. void menu::line_hor(int column1, int column2, int row, char ch)
  82. {
  83.     for(column1;column1<=column2; column1++)
  84.     {
  85.         gotoxy(column1,row);
  86.         cin>>ch;
  87.     }
  88. }
  89.  
  90. void menu::line_ver(int row1, int row2, int column, char ch)
  91. {
  92.     for(row1; row1<=row2; row1++)
  93.     {
  94.         gotoxy(column,row1);
  95.         cin>>ch;
  96.     }
  97. }
  98.  
  99. void menu::box_password(void)
  100. {
  101.     line_hor(2,79,1,219);
  102.     line_hor(2,79,24,219);
  103.     line_ver(1,24,2,219);
  104.     line_ver(1,24,79,219);
  105.     delay(50);
  106.     line_hor(3,78,2,219);
  107.     line_hor(3,78,23,219);
  108.     line_ver(2,23,3,219);
  109.     line_ver(2,23,78,219);
  110.     delay(50);
  111.     line_hor(4,77,3,219);
  112.     line_hor(4,77,22,219);
  113.     line_ver(3,22,4,219);
  114.     line_ver(3,22,77,219);
  115.     delay(50);
  116.     line_hor(5,76,4,178);
  117.     line_hor(5,76,21,178);
  118.     line_ver(4,21,5,178);
  119.     line_ver(4,21,76,178);
  120.     delay(50);
  121.     line_hor(6,75,5,178);
  122.     line_hor(6,75,20,178);
  123.     line_ver(5,20,6,178);
  124.     line_ver(5,20,75,178);
  125.     delay(50);
  126.     line_hor(7,74,6,178);
  127.     line_hor(7,74,19,178);
  128.     line_ver(6,19,7,178);
  129.     line_ver(6,19,74,178);
  130.     delay(50);
  131.     line_hor(8,73,7,177);
  132.     line_hor(8,73,18,177);
  133.     line_ver(7,18,8,177);
  134.     line_ver(7,18,73,177);
  135.     delay(50);
  136.     line_hor(9,72,8,177);
  137.     line_hor(9,72,17,177);
  138.     line_ver(8,17,9,177);
  139.     line_ver(8,17,72,177);
  140.     delay(50);
  141.     line_hor(10,71,9,177);
  142.     line_hor(10,71,16,177);
  143.     line_ver(9,16,10,177);
  144.     line_ver(9,16,91,177);
  145.     delay(50);
  146. }
  147.  
  148. void menu::box_menu(void)
  149. {
  150.     line_hor(2,79,1,219);
  151.     line_hor(2,79,24,219);
  152.     line_ver(1,24,2,219);
  153.     line_ver(1,24,79,219);
  154.     delay(50);
  155.     line_hor(3,78,2,178);
  156.     line_hor(3,78,23,178);
  157.     line_ver(2,23,3,178);
  158.     line_ver(2,23,78,178);
  159.     delay(50);
  160.     line_hor(4,77,3,177);
  161.     line_hor(4,77,22,177);
  162.     line_ver(3,22,4,177);
  163.     line_ver(3,22,77,177);
  164.     delay(50);
  165. }
  166.  
  167. void menu::enter_password(void)
  168. {
  169.     clrscr();
  170.     char pass1,pass2,pass3;
  171.     box_password();
  172.     gotoxy(30,12);
  173.     cout<<"Enter the password:";
  174.     pass1=getch();
  175.     cout<<"*";
  176.     pass2=getch();
  177.     cout<<"*";
  178.     pass3=getch();
  179.     cout<<"*";
  180. //  sound(500);
  181.     delay(100);
  182.     nosound();
  183.     if (pass1=='h'&&pass2=='m'&&pass3=='s')
  184.     return;
  185.     gotoxy(30,12);
  186.     cout<<"WORNG PASSWORD";
  187.     gotoxy(2,1);
  188.     getch();
  189.     exit(0);
  190. }
  191.  
  192. void menu::main_menu(void)
  193. {
  194.     char ch;
  195.     char h[]={""};
  196.     char m[]={""};
  197.     int j;
  198.     while(1)
  199.     {
  200.         clrscr();
  201.         box_menu();
  202.         j=9;
  203.         for(int i=0; h[i]!='0';i++);
  204. {
  205.     gotoxy(15,j);
  206.     j++;
  207.     cout<<h[i];
  208. }
  209. j=7;
  210. for(i=0; m[i]!='0'; i++)
  211. {
  212.     gotoxy(65,j);
  213.     j++;
  214.     cout<<m[i];
  215. }
  216. gotoxy(30,5);
  217. cout<<"1. CHECK IN";
  218. gotoxy(30,7);
  219. cout<<"2. CHECK OUT";
  220. gotoxy(30,9);
  221. cout<<"3. CUSTOMER RECORD";
  222. gotoxy(30,11);
  223. cout<<"4. ROOM RECORD";
  224. gotoxy(30,13);
  225. cout<<"5. EDIT";
  226. gotoxy(30,15);
  227. cout<<"6. REPORT";
  228. gotoxy(30,17);
  229. cout<<"7. HELP";
  230. gotoxy(30,19);
  231. cout<<"0. EXIT";
  232. gotoxy(30,21);
  233. cout<<"Enter your Choice:";
  234. ch=getch();
  235. if(ch=='1')
  236. {
  237.     customer c;
  238.     c.checkin();
  239. }
  240. else
  241. if(ch=='2')
  242. {
  243.     customer c;
  244.     c.checkout();
  245. }
  246. if(ch=='3')
  247. {
  248.     customer c;
  249.     c.display_customer_record();
  250. }
  251. else
  252. if(ch=='4')
  253. {
  254.     room r;
  255.     r.display_room_record();
  256. }
  257. else
  258. if(ch=='5')
  259.             edit_menu();
  260.         else
  261.         if(ch=='6')
  262.             report_menu();
  263.         else
  264.         if(ch=='7')
  265.         {
  266.         clrscr();
  267.         textcolor(BLUE+BLINK);
  268.         textbackground(BLACK);
  269.         gotoxy(31,1);
  270.         cprintf("WELCOME TO HELP");
  271.         textcolor(LIGHTGRAY);
  272.         textbackground(BLACK);
  273.         gotoxy(3,3);
  274.         cout<<"TO ADD/MODIFY/DELETE ROOM RECORDS::";
  275.         gotoxy(3,4);
  276.         cout<<"-------------------------------------";
  277.         gotoxy(3,5);
  278.         cout<<"1. Select edit option(5).";
  279.         gotoxy(3,7);
  280.         cout<<"2. Go to option(1).";
  281.         gotoxy(3,9);
  282.         cout<<"3. Select (1),(2) or (3) to add, modify or delete rooms";
  283.         cout<<"records.";
  284.         gotoxy(3,12);
  285.         cout<<"TO CHECK IN OR CHECK OUT THE CUSTOMER::";
  286.         gotoxy(3,13);
  287.         cout<<"-------------------------------------";
  288.         gotoxy(3,14);
  289.         cout<<"1. Select option(1) for check in.";
  290.         gotoxy(3,16);
  291.         cout<<"2. Select option(2) for check out and bill";
  292.         cout<<"preparation.";
  293.         gotoxy(3,19);
  294.         cout<<"TO SEARCH FOR ROOM/CUSTOMER::";
  295.         gotoxy(3,20);
  296.         cout<<"--------------------------------------";
  297.         gotoxy(3,21);
  298.         cout<<"1. Select option(3) for room search.";
  299.         gotoxy(3,23);
  300.         cout<<"2. Select option(4) for customer search.";
  301.         textcolor(LIGHTGRAY+BLINK);
  302.         gotoxy(27,25);
  303.         cprintf("Press any key to continue");
  304.         textcolor(LIGHTGRAY);
  305.         getch();
  306.         clrscr();
  307.         textcolor(BLUE+BLINK);
  308.         textbackground(BLACK);
  309.         gotoxy(31,1);
  310.         cprintf("WELCOME TO HELP");
  311.         textcolor(WHITE);
  312.         textbackground(BLACK);
  313.         gotoxy(3,3);
  314.         cout<<"REPORT GENERATION (ROOM/CUSTOMER)::";
  315.         gotoxy(3,4);
  316.         cout<<"-----------------------------------------";
  317.         gotoxy(3,6);
  318.         cout<<"1. Select report option(6), select(1) to view record";
  319.         cout<<" of customers.";
  320.         gotoxy(3,11);
  321.         cout<<"TO MODIFY/DELETE CUSTOMER RECORDS::";
  322.         gotoxy(3,12);
  323.         cout<<"-----------------------------------------";
  324.         gotoxy(3,14);
  325.         cout<<"1. Select edit option(5).";
  326.         gotoxy(3,16);
  327.         cout<<"2. Go to option(2).";
  328.         gotoxy(3,18);
  329.         cout<<"3. Select (1) or (2) to modify or delete customer";
  330.         cout<<"records.";
  331.         textcolor(LIGHTGRAY+BLINK);
  332.         gotoxy(27,25);
  333.         cprintf("Press any key to continue");
  334.         textcolor(15);
  335.         getch();
  336.         }
  337.         closegraph();
  338.         if(ch=='0')
  339.         break;
  340.     }
  341. }
  342.  
  343. void menu::edit_menu(void)
  344. {
  345.     char ch;
  346.     while(1)
  347.     {
  348.         clrscr();
  349.         box_menu();
  350.         gotoxy(30,6);
  351.         cout<<"EDIT";
  352.         gotoxy(30,8);
  353.         cout<<"1. ROOM RECORDS";
  354.         gotoxy(30,10);
  355.         cout<<"2. CUSTOMER RECORDS";
  356.         gotoxy(30,12);
  357.         cout<<"0. EXIT";
  358.         gotoxy(30,15);
  359.         cout<<"Enter your choice:";
  360.         ch=getch();
  361.         if(ch=='1')
  362.             room_edit_menu();
  363.         else
  364.         if(ch=='2')
  365.             customer_edit_menu();
  366.         else
  367.         if(ch=='0')
  368.         break;
  369.     }
  370. }
  371.  
  372. void menu::room_edit_menu(void)
  373. {
  374.     char ch;
  375.     while(1)
  376.     {
  377.         clrscr();
  378.         box_menu();
  379.         gotoxy(30,8);
  380.         cout<<"1. ADD FROM RECORDS";
  381.         gotoxy(30,10);
  382.         cout<<"2. MODIFY ROOM RECORDS";
  383.         gotoxy(30,12);
  384.         cout<<"3. DELETE ROOM RECORDS";
  385.         gotoxy(30,14);
  386.         cout<<"0. EXIT";
  387.         gotoxy(30,17);
  388.         cout<<"Enter your choice:";
  389.         if(ch=='1')
  390.         {
  391.             room r;
  392.             r.add();
  393.         }
  394.         else
  395.         if(ch=='2')
  396.         {
  397.             room r;
  398.             r.modify();
  399.         }
  400.         else
  401.         if(ch=='3')
  402.         {
  403.             room r;
  404.             r.deletion();
  405.         }
  406.         else
  407.         if(ch=='0')
  408.         break;
  409.     }
  410. }
  411.  
  412. void menu::customer_edit_menu(void)
  413. {
  414.  
  415.     char ch;
  416.     while(1)
  417.     {
  418.         clrscr();
  419.         box_menu();
  420.         gotoxy(30,8);
  421.         cout<<"1. MODIFY CUSTOMER RECORDS";
  422.         gotoxy(30,10);
  423.         cout<<"2. DELETE CUSTOMER RECORDS";
  424.         gotoxy(30,12);
  425.         cout<<"0. EXIT";
  426.         gotoxy(30,15);
  427.         cout<<"Enter your choice:";
  428.         ch=getch();
  429.         if(ch=='1')
  430.         {
  431.             customer c;
  432.             c.modify();
  433.         }
  434.         else
  435.         if(ch=='2')
  436.         {
  437.             customer c;
  438.             c.deletion();
  439.         }
  440.         else
  441.         if(ch=='0')
  442.         break;
  443.     }
  444. }
  445.  
  446. void menu::report_menu(void)
  447. {
  448.     char ch;
  449.     while(1)
  450.     {
  451.         clrscr();
  452.         box_menu();
  453.         gotoxy(30,8);
  454.         cout<<"1. LIST OF ROOMS";
  455.         gotoxy(30,10);
  456.         cout<<"2. LIST OF CUSTOMERS";
  457.         gotoxy(30,12);
  458.         cout<<"0. EXIT";
  459.         gotoxy(30,15);
  460.         cout<<"Enter your choice:";
  461.         ch=getch();
  462.         if(ch=='1')
  463.         {
  464.             room r;
  465.             r.display_list();
  466.         }
  467.         else
  468.         if(ch=='2')
  469.         {
  470.             customer c;
  471.             c.display_list();
  472.         }
  473.         else
  474.         if(ch=='0')
  475.         break;
  476.     }
  477. }
  478.  
  479. int room::room_found(int t_roomno)
  480. {
  481.     fstream file;
  482.     file.open("ROOM.TXT",ios::in);
  483.     file.seekg(0);
  484.     int found=0;
  485.     while(file.read((char*) this, sizeof(room)))
  486.     {
  487.         if(roomno==t_roomno)
  488.             found=1;
  489.     }
  490.     file.close();
  491.     return found;
  492. }
  493.  
  494. void room::display_list(void)
  495. {
  496.     clrscr();
  497.     fstream file;
  498.     file.open("ROOM TEXT",ios::in);
  499.     file.seekg(0);
  500.     int row=5, found=0, pageno=1;
  501.     gotoxy(18,1);
  502.     cout<<"LIST OF ROOMS";
  503.     gotoxy(1,3);
  504.     cout<<"Room code     Rooom no.     Status     Tarriff";
  505.     while(file.read((char*) this, sizeof(room)));
  506.      {
  507.         delay(20);
  508.         found=1;
  509.         gotoxy(2,row);
  510.         cin>>roomcode;
  511.         gotoxy(16,row);
  512.         cin>>roomno;
  513.         gotoxy(29,row);
  514.         cin>>status;
  515.         gotoxy(42,row);
  516.         cin>>tarriff;
  517.         if(row==23)
  518.         {
  519.         row=5;
  520.         gotoxy(66,1);
  521.         cout<<"Page no.:"<<pageno;
  522.         pageno++;
  523.         gotoxy(1,25);
  524.         cout<<"Press any key to continue...";
  525.         getch();
  526.         clrscr();
  527.         gotoxy(18,1);
  528.         cout<<"LIST OF ROOMS";
  529.         gotoxy(1,3);
  530.         cout<<"Room code     Rooom no.     Status     Tarriff";
  531.         }
  532.         else
  533.             row++;
  534.     }
  535.     if(!found)
  536.     {
  537.         sound(500);
  538.         delay(100);
  539.         nosound();
  540.         gotoxy(1,5);
  541.         cout<<"Records not found";
  542.     }
  543.     gotoxy(66,1);
  544.     cout<<"page no.:"<<pageno;
  545.     gotoxy(1,25);
  546.     cout<<"Pree any key to continue...";
  547.     getch();
  548.     file.close();
  549. }
  550.  
  551. int room::recordno(int t_roomno)
  552. {
  553.     fstream file;
  554.     file.open("ROOM.TXT",ios::in);
  555.     file.seekg(0);
  556.     int count=0;
  557.     while(file.read((char*) this, sizeof(room)))
  558.     {
  559.         count++;
  560.         if(t_roomno==roomno)
  561.             break;
  562.     }
  563.     file.close();
  564.     return count;
  565. }
  566.  
  567. void room::display_record(int t_roomno)
  568. {
  569.     fstream file;
  570.     file.open("ROOM.TXT",ios::in);
  571.     file.seekg(0);
  572.     int found=0;
  573.     while(file.read((char *) this, sizeof(room))&&!found)
  574.     {
  575.         if (t_roomno==roomno)
  576.         {
  577.             found=1;
  578.             gotoxy(1,5);
  579.             cout<<"Room code:"<<roomcode;
  580.             gotoxy(1,6);
  581.             cout<<"Room no.:"<<roomno;
  582.             gotoxy(1,7);
  583.             cout<<"Status:"<<status;
  584.             gotoxy(1,8);
  585.             cout<<"Tarriff:"<<tarriff;
  586.         }
  587.     }
  588.     file.close();
  589. }
  590.  
  591. void room::display_room_record(void)
  592. {
  593.     clrscr();
  594.     int valid;
  595.     int t_roomno;
  596.     gotoxy(1,3);
  597.    
  598.     cout<<"Enter the Room no.:";
  599.     cin>>t_roomno;
  600.     if(!room_found(t_roomno))
  601.     {
  602.         sound(500);
  603.         delay(100);
  604.         nosound();
  605.         gotoxy(1,25); clreol();
  606.         gotoxy(1,24);
  607.         cout<<"ROOM NO. NOT FOUND";
  608.         gotoxy(1,25);
  609.         cout<<"Press any key to continue...";
  610.         getch();
  611.         return;
  612.     }
  613.     clrscr();
  614.     gotoxy(5,3);
  615.     cout<<"ROOM RECORD";
  616.     display_record(t_roomno);
  617.     gotoxy(1,25);
  618.     cout<<"Press any key to continue...";
  619.     getch();
  620. }
  621.  
  622. void room::change_status(int t_roomno, char t_status)
  623. {
  624.     int recno;
  625.     recno=recordno(t_roomno);
  626.     fstream file;
  627.     file.open("ROOM.TXT",ios::out|ios::ate);
  628.     int location;
  629.     location=(recno-1)*sizeof(room);
  630.     file.seekg(location);
  631.     status=t_status;
  632.     file.write((char*) this, sizeof(room));
  633.     file.close();
  634. }
  635.  
  636. char room::room_status(int t_roomno)
  637. {
  638.     fstream file;
  639.     file.open("ROOM.TXT",ios::in);
  640.     file.seekg(0);
  641.     int found=0;
  642.     char t_status;
  643.     while(file.read((char*) this, sizeof(room))&&!found)
  644.     {
  645.         if(t_roomno==roomno)
  646.         {
  647.             found=1;
  648.             t_status=status;
  649.         }
  650.     }
  651.     file.close();
  652.     return t_status;
  653. }
  654.  
  655. float room::get_data(int t_roomno)
  656. {
  657.     fstream file;
  658.     file.open("ROOM.TXT",ios::in);
  659.     file.seekg(0);
  660.     float t_tarriff;
  661.     while(file.read((char*) this, sizeof(room)));
  662.     {
  663.         if(t_roomno==roomno)
  664.         {
  665.             t_tarriff=tarriff;
  666.  
  667.         }
  668.     }
  669.     file.close();
  670.     return t_tarriff;
  671. }
  672.  
  673. void room::add(void)
  674. {
  675.     char ch;
  676.     char t_rcode[5];
  677.     int t_roomno;
  678.     char t_status;
  679.     float t_tarriff;
  680.     do
  681.     {
  682.     fstream file;
  683.     file.open("ROOM.TXT",ios::out|ios::app);
  684.     clrscr();
  685.     gotoxy(1,1);
  686.     cout<<"Enter the details for the room";
  687.     gotoxy(1,3);
  688.     cout<<"Code:";
  689.     gotoxy(1,4);
  690.     cout<<"Room no.:";
  691.     gotoxy(1,5);
  692.     cout<<"Status:";
  693.     gotoxy(1,6);
  694.     cout<<"Tarriff:";
  695.     gotoxy(20,11);
  696.     cout<<"SS: SINGLE SUITE";
  697.     gotoxy(20,12);
  698.     cout<<"SR: SINGLE ROOM:";
  699.     gotoxy(20,13);
  700.     cout<<"DR: DOUBLE ROOM:";
  701.     gotoxy(20,14);
  702.     cout<<"DS: DOUBLE SUITE:";
  703.     int valid=0;
  704.     do
  705.     {
  706.         valid=1;
  707.         gotoxy(1,25);
  708.         cout<<"ENTER THE ROOM CODE (SS/SR/DR/DS)";
  709.         gotoxy(13,3);
  710.         cin>>t_rcode;
  711.         strupr(t_rcode);
  712.         char*string[4]={"SS","DR","SR","DS"};
  713.         int result, count=0;
  714.         for(int i=0; i<4; i++)
  715.         {
  716.             result=strcmpi(t_rcode,string[i]);
  717.             if(result !=0)
  718.             count++;
  719.         }
  720.         if(count==4)
  721.         {
  722.             valid=0;
  723.             sound(500);
  724.             delay(100);
  725.             nosound();
  726.             gotoxy(1,25); clreol();
  727.             gotoxy(1,24);
  728.             cout<<"INVALID CODE";
  729.             gotoxy(1,25);
  730.             cout<<"Press any key to continue...";
  731.             getch();
  732.             gotoxy(1,24); clreol();
  733.             gotoxy(1,25); clreol();
  734.             gotoxy(13,3); clreol();
  735.         }
  736.     } while(valid==0);
  737.     for(int i=11; i<14; i++)
  738.     {
  739.         gotoxy(1,1); clreol();
  740.     }
  741.     do
  742.     {
  743.         valid=1;
  744.         gotoxy(1,25); clreol();
  745.         gotoxy(1,25);
  746.         cout<<"ENTER THE ROOM NUMBER";
  747.         gotoxy(13,4);
  748.         cin>>t_roomno;
  749.         if(t_roomno<=0||t_roomno>900)
  750.         {
  751.             valid=0;
  752.             sound(500);
  753.             delay(100);
  754.             nosound();
  755.             gotoxy(1,25); clreol();
  756.             gotoxy(1,24);
  757.             cout<<"IT SHOULD NOT BE NEGATIVE OR ZERO OR";
  758.             cout<<"GREATER THAN 900";
  759.             gotoxy(1,25);
  760.             cout<<"Press any key to continue...";
  761.             getch();
  762.             gotoxy(1,24); clreol();
  763.             gotoxy(1,25); clreol();
  764.             gotoxy(13,4); clreol();
  765.         }
  766.         if(room_found(t_roomno))
  767.         {
  768.             valid=0;
  769.             sound(500);
  770.             delay(100);
  771.             nosound();
  772.             gotoxy(1,25); clreol();
  773.             gotoxy(1,24);
  774.             cout<<"ROOM NO. ALREADY EXIST";
  775.             gotoxy(1,25);
  776.             cout<<"Press any key to continue...";
  777.             getch();
  778.             gotoxy(1,24); clreol();
  779.             gotoxy(1,25); clreol();
  780.             gotoxy(13,4); clreol();
  781.         }
  782.     } while(!valid);
  783.     do
  784.     {
  785.         valid=1;
  786.         gotoxy(1,25); clreol();
  787.         gotoxy(1,25);
  788.         cout<<"ENTER THE ROOM STATUS: V=vacant, O=occupied";
  789.         gotoxy(13,5);
  790.         cin>>t_status;
  791.         t_status=toupper(t_status);
  792.         if(t_status !='0' && t_status !='v')
  793.         {
  794.             valid=0;
  795.             sound(500);
  796.             delay(100);
  797.             nosound();
  798.             gotoxy(1,25); clreol();
  799.             gotoxy(1,24);
  800.             cout<<"INVALID DATE ENTERED";
  801.             gotoxy(1,25);
  802.             cout<<"Press any key to continue...";
  803.             getch();
  804.             gotoxy(1,24); clreol();
  805.             gotoxy(1,25); clreol();
  806.             gotoxy(13,5); clreol();
  807.         }
  808.     } while(!valid);
  809.     do
  810.     {
  811.         valid=1;
  812.         gotoxy(1,25); clreol();
  813.         gotoxy(1,25);
  814.         cout<<"ENTER THE TARRIFF FOR THE ROOM";
  815.         gotoxy(13,6);
  816.         cin>>t_tarriff;
  817.         if(t_tarriff<=0)
  818.         {
  819.             valid=0;
  820.             sound(500);
  821.             delay(100);
  822.             nosound();
  823.             gotoxy(1,25); clreol();
  824.             gotoxy(1,24);
  825.             cout<<"IT SHOULD NOT BE NEGATIVE OR ZERO";
  826.             gotoxy(1,25);
  827.             cout<<"Press any key to continue...";
  828.             getch();
  829.             gotoxy(1,24); clreol();
  830.             gotoxy(1,25); clreol();
  831.             gotoxy(13,6); clreol();
  832.         }
  833.     } while(!valid);
  834.     gotoxy(1,8);
  835.     cout<<"Do you want to save the record (y/n):";
  836.     do
  837.     {
  838.         valid=1;
  839.         gotoxy(42,8);
  840.         ch=getch();
  841.         ch=toupper(ch);
  842.         if(ch !='Y' && ch !='N')
  843.         {
  844.             valid=0;
  845.             sound(500);
  846.             delay(100);
  847.             nosound();
  848.             gotoxy(42,8); clreol();
  849.         }
  850.     } while(!valid);
  851.     if(ch=='Y')
  852.     {
  853.         strcpy(roomcode,t_rcode);
  854.         roomno=t_roomno;
  855.         status=t_status;
  856.         tarriff=t_tarriff;
  857.         file.write((char*) this, sizeof(room));
  858.     }
  859.     gotoxy(1,9);
  860.     cout<<"Do you want to add more records (y/n):";
  861.     do
  862.     {
  863.         valid=1;
  864.         gotoxy(42,9);
  865.         ch=getch();
  866.         ch=toupper(ch);
  867.         if(ch !='Y' && ch !='N')
  868.         {
  869.             valid=0;
  870.             sound(500);
  871.             delay(100);
  872.             nosound();
  873.             gotoxy(42,9); clreol();
  874.         }
  875.     } while(!valid);
  876.     file.close();
  877.     } while(ch=='Y');
  878. }
  879.  
  880. void room::modify(void)
  881. {
  882.     clrscr();
  883.     int valid;
  884.     char ch;
  885.     char t_rcode[5];
  886.     int t_roomno, tr;
  887.     char t_status;
  888.     float t_tarriff;
  889.     fstream file;
  890.     file.open("ROOM.TXT",ios::out|ios::ate);
  891.     gotoxy(1,3);
  892.     cout<<"Enter the Room no. to be modified";
  893.     cin>>tr;
  894.     if(!room_found(tr))
  895.     {
  896.         sound(500);
  897.         delay(100);
  898.         nosound();
  899.         gotoxy(1,25); clreol();
  900.         gotoxy(1,24);
  901.         cout<<"ROOM NO. NOT FOUND";
  902.         gotoxy(1,25);
  903.         cout<<"Press any key to continue...";
  904.         getch();
  905.         return;
  906.     }
  907.     display_record(tr);
  908.     gotoxy(1,10);
  909.     cout<<"Do you want to modify this Room Record (y/n):";
  910.     do
  911.     {
  912.         valid=1;
  913.         gotoxy(48,10);
  914.         ch=getch();
  915.         ch=toupper(ch);
  916.         if(ch !='Y' && ch !='N')
  917.         {
  918.             valid=0;
  919.             sound(500);
  920.             delay(100);
  921.             nosound();
  922.             gotoxy(42,9); clreol();
  923.         }
  924.     } while(!valid);
  925.     if (ch=='N')
  926.         return;
  927.     gotoxy(1,12);
  928.     cout<<"ENTER THE NEW DATA FOR THE ROOM";
  929.     gotoxy(1,14);
  930.     cout<<"Code:";
  931.     gotoxy(1,15);
  932.     cout<<"Room no.:";
  933.     gotoxy(1,16);
  934.     cout<<"Status:";
  935.     gotoxy(1,17);
  936.     cout<<"Tarriff:";
  937.     do
  938.     {
  939.         valid=1;
  940.         gotoxy(1,25);
  941.         cout<<"ENTER THE ROOM CODE (SS/SR/DR/DS)";
  942.         gotoxy(13,14);
  943.         cin>>t_rcode;
  944.         strupr(t_rcode);
  945.         char *string[4]={"SS","DR","SR","DS"};
  946.         int result, count=0;
  947.         for(int i=0; i<4; i++)
  948.         {
  949.             result=strcmpi(t_rcode,string[i]);
  950.             if(result !=0)
  951.             count++;
  952.         }
  953.         if(count==4)
  954.         {
  955.             valid=0;
  956.             sound(500);
  957.             delay(100);
  958.             nosound();
  959.             gotoxy(1,25); clreol();
  960.             gotoxy(1,24);
  961.             cout<<"INVALID CODE";
  962.             gotoxy(1,25);
  963.             cout<<"Press any key to continue...";
  964.             getch();
  965.             gotoxy(1,24); clreol();
  966.             gotoxy(1,25); clreol();
  967.             gotoxy(13,14); clreol();
  968.         }
  969.     } while(valid==0);
  970.     do
  971.     {
  972.         valid=1;
  973.         gotoxy(1,25); clreol();
  974.         gotoxy(1,25);
  975.         cout<<"ENTER THE ROOM NUMBER";
  976.         gotoxy(13,15);
  977.         cin>>t_roomno;
  978.         if(t_roomno<=0||t_roomno>900)
  979.         {
  980.             valid=0;
  981.             sound(500);
  982.             delay(100);
  983.             nosound();
  984.             gotoxy(1,25); clreol();
  985.             gotoxy(1,24);
  986.             cout<<"IT SHOULD NOT BE NEGATIVE OR ZERO OR";
  987.             cout<<"GREATER THAN 900";
  988.             gotoxy(1,25);
  989.             cout<<"Press any key to continue...";
  990.             getch();
  991.             gotoxy(1,24); clreol();
  992.             gotoxy(1,25); clreol();
  993.             gotoxy(13,15); clreol();
  994.         }
  995.         if(room_found(t_roomno)&&t_roomno !=tr)
  996.         {
  997.             valid=0;
  998.             sound(500);
  999.             delay(100);
  1000.             nosound();
  1001.             gotoxy(1,25); clreol();
  1002.             gotoxy(1,24);
  1003.             cout<<"ROOM NO. ALREADY EXIST";
  1004.             gotoxy(1,25);
  1005.             cout<<"Press any key to continue...";
  1006.             getch();
  1007.             gotoxy(1,24); clreol();
  1008.             gotoxy(1,25); clreol();
  1009.             gotoxy(13,15); clreol();
  1010.         }
  1011.     } while(!valid);
  1012.     do
  1013.     {
  1014.         valid=1;
  1015.         gotoxy(1,25); clreol();
  1016.         gotoxy(1,25);
  1017.         cout<<"ENTER THE ROOM STATUS: V=vacant, O=occupied";
  1018.         gotoxy(13,16);
  1019.         cin>>t_status;
  1020.         t_status=toupper(t_status);
  1021.         if(t_status !='0' && t_status !='V')
  1022.         {
  1023.             valid=0;
  1024.             sound(500);
  1025.             delay(100);
  1026.             nosound();
  1027.             gotoxy(1,25); clreol();
  1028.             gotoxy(1,24);
  1029.             cout<<"INVALID DATA ENTERED";
  1030.             gotoxy(1,25);
  1031.             cout<<"Press any key to continue...";
  1032.             getch();
  1033.             gotoxy(1,24); clreol();
  1034.             gotoxy(1,25); clreol();
  1035.             gotoxy(13,16); clreol();
  1036.         }
  1037.     } while(!valid);
  1038.     do
  1039.     {
  1040.         valid=1;
  1041.         gotoxy(1,25); clreol();
  1042.         gotoxy(1,25);
  1043.         cout<<"ENTER THE TARRIFF FOR THE ROOM";
  1044.         gotoxy(13,17);
  1045.         cin>>t_tarriff;
  1046.         if(t_tarriff<=0)
  1047.         {
  1048.             valid=0;
  1049.             sound(500);
  1050.             delay(100);
  1051.             nosound();
  1052.             gotoxy(1,25); clreol();
  1053.             gotoxy(1,24);
  1054.             cout<<"IT SHOULD NOT BE NEGATIVE OR ZERO";
  1055.         gotoxy(1,25);
  1056.             cout<<"Press any key to continue...";
  1057.             getch();
  1058.             gotoxy(1,24); clreol();
  1059.             gotoxy(1,25); clreol();
  1060.             gotoxy(13,17); clreol();
  1061.         }
  1062.     } while (!valid);
  1063.     gotoxy(1,19);
  1064.     cout<<"Do you want to save the record (y/n) : ";
  1065.     do
  1066.     {
  1067.         valid = 1;
  1068.         gotoxy(42,19);
  1069.         ch = getch();
  1070.         ch = toupper(ch);
  1071.         if (ch !='Y' && ch != 'N')
  1072.         {
  1073.             valid = 0;
  1074.             sound(500);
  1075.             delay(100);
  1076.             nosound();
  1077.             gotoxy(42,19); clreol();
  1078.         }
  1079.     } while(!valid);
  1080.     if (ch=='Y')
  1081.     {
  1082.         int recno;
  1083.         recno = recordno(tr);
  1084.         int location;
  1085.         location = (recno-1) * sizeof (room);
  1086.         file.seekp(location);
  1087.         strcpy (roomcode,t_rcode);
  1088.         roomno = t_roomno;
  1089.         status = t_status;
  1090.         tarriff = t_tarriff;
  1091.         file.write((char *) this, sizeof (room));
  1092.     }
  1093.     file.close ();
  1094. }
  1095. void room :: deletion(void)
  1096. {
  1097.     clrscr();
  1098.     int valid;
  1099.     char ch;
  1100.     int t_roomno;
  1101.     gotoxy(1,3);
  1102.     cout<<"Enter the room no. to be deleted ";
  1103.     cin>>t_roomno;
  1104.     if (!room_found( t_roomno))
  1105.     {
  1106.     sound(500);
  1107.     delay(100);
  1108.     nosound();
  1109.     gotoxy(1,25); clreol();
  1110.     gotoxy(1,24);
  1111.     cout<<"ROOM NO. NOT FOUND";
  1112.     gotoxy(1,25);
  1113.     cout<<"Press any key to continue...";
  1114.     getch();
  1115.  
  1116. }
  1117. display_record(t_roomno);
  1118. gotoxy(1,10);
  1119. cout<<"Do you want to delete this Room record (y/n) : ";
  1120. do
  1121. {
  1122.     valid = 1;
  1123.     gotoxy(48,10);
  1124.     ch = getche();
  1125.     ch = toupper (ch);
  1126.     if (ch != 'Y' && ch != 'N')
  1127.     {
  1128.         valid = 0;
  1129.         sound(500);
  1130.         delay(100);
  1131.         nosound();
  1132.         gotoxy(42,9); clreol();
  1133.     }
  1134. } while ( !valid);
  1135. if (ch == 'N')
  1136.         return;
  1137. fstream file;
  1138. file.open("ROOM.TXT", ios::in);
  1139. fstream temp;
  1140. temp.open ("temp.txt", ios::out);
  1141. while (!file.eof())
  1142. {
  1143.     file.read((char *) this, sizeof(room));
  1144.     if ( file.eof())
  1145.             break;
  1146.     if ( roomno !=t_roomno)
  1147.             temp.write((char *) this, sizeof(room));
  1148. }
  1149. file.close();
  1150. temp.close();
  1151. file.open("ROOM.TXT", ios::out);
  1152. temp.open("temp.txt", ios::in);
  1153. temp.seekg(0);
  1154. while (!temp.eof())
  1155. {
  1156.     temp.read((char *) this, sizeof(room));
  1157.     if (temp.eof())
  1158.         break;
  1159.     file.write((char *) this, sizeof(room));
  1160.     }
  1161.     file.close();
  1162.     temp.close();
  1163. }
  1164.  
  1165. void customer :: display_list(void)
  1166. {
  1167.     clrscr();
  1168.     fstream file;
  1169.     file.open("CUSTOMER.TXT", ios::out);
  1170.     file.seekg(0);
  1171.     int row = 5, found = 0, pageno = 1, total = 0;
  1172.     gotoxy(18,1);
  1173.     cout<<"LIST OF CUSTOMER" ;
  1174.     gotoxy(1,3);
  1175.     cout<<" ROOM no. NAME               PHONE               ROOM    SERVICE";
  1176.     cout<<"Advances Misc.";
  1177.     while (file.read((char *) this, sizeof(customer)))
  1178.     {
  1179.         total++;
  1180.         delay(20);
  1181.         found = 1;
  1182.         gotoxy(2,row);
  1183.         cin>>roomno;
  1184.         gotoxy(12,row);
  1185.         puts(name);
  1186.         fflush(stdout);
  1187.         gotoxy(34,row);
  1188.         cin>>phone;
  1189.         gotoxy(47,row);
  1190.         cin>>room_srv;
  1191.         gotoxy(62,row);
  1192.         cin>>advance;
  1193.         gotoxy(72,row);
  1194.         cin>>misc;
  1195.         if ( row == 23)
  1196.         {
  1197.  
  1198.             row = 5 ;
  1199.             gotoxy(66,1);
  1200.             cout<<"Page no. : "<<pageno;
  1201.             pageno++;
  1202.             gotoxy(1,25);
  1203.             cout<<"Press any key to continue...";
  1204.             getche();
  1205.             clrscr();
  1206.             gotoxy(18,1);
  1207.             cout<<"LIST OF CUSTOMER:";
  1208.             gotoxy(1,3);
  1209.             cout<<"Room no. NAME        Phone";
  1210.             cout<<"Room service Advance  Misc.";
  1211.         }
  1212.     else
  1213.     row++;
  1214.     }
  1215.     if ( !found )
  1216.     {
  1217.         sound (500);
  1218.         delay(100);
  1219.         nosound();
  1220.         gotoxy(1,5);
  1221.         cout<<"Record not found";
  1222.     }
  1223.     gotoxy(66,1);
  1224.     cout<<"Page no. : " <<pageno;
  1225.     gotoxy(1,25);
  1226.     cout<<"Press any key to continue...";
  1227.     getch();
  1228.     clrscr();
  1229.     gotoxy(1,5);
  1230.     cout<<"Total no. of Customer = " <<total;
  1231.     gotoxy(2,25);
  1232.     cout<<"Press any key to continue...";
  1233.     getch();
  1234.     file.close();
  1235. }
  1236.        
  1237. void customer :: checkin(void)
  1238. {
  1239.        
  1240.     room r;
  1241.     char ch;
  1242.     int valid = 1;
  1243.     int t_roomno , t_no_cust;
  1244.     char t_name[21] , t_address[35] , t_phone[8] , t_nation[16];
  1245.     char t_passport[30];
  1246.     float t_advance , t_misc , t_room_srv;
  1247.     clrscr();
  1248.     gotoxy(1,1);
  1249.     cout<<"Enter the details of the Customer";
  1250.     gotoxy(1,3);
  1251.     cout<<"Room no.         : ";
  1252.     gotoxy(1,4);
  1253.     cout<<"Name             : ";
  1254.     gotoxy(1,5);
  1255.     cout<<"No. of guests    : ";
  1256.     gotoxy(1,6);
  1257.     cout<<"Address          : ";
  1258.     gotoxy(1,7);
  1259.     cout<<"Phone            : ";
  1260.     gotoxy(1,8);
  1261.     cout<<"Nationality      : ";
  1262.     gotoxy(1,9);
  1263.     cout<<"Passport no.     : ";
  1264.     gotoxy(1,11);
  1265.     cout<<"Advance          : ";
  1266.     gotoxy(1,12);
  1267.     cout<<"Miscellineous    : ";
  1268.     gotoxy(1,13);
  1269.     cout<<"Room Service     : ";
  1270.     gotoxy(20,3);
  1271.     cin>>t_roomno;
  1272.     char t_status;
  1273.     t_status = r.room_status(t_roomno);
  1274.     if (!r.room_found(t_roomno) || t_status == '0')
  1275.     {
  1276.         sound(500);
  1277.         delay(100);
  1278.         nosound();
  1279.         gotoxy(1,25); clreol();
  1280.         gotoxy(1,24);
  1281.         cout<<"ROOM NO. NOT FOUND OR NOT VACANT";
  1282.         gotoxy(1,25);
  1283.         cout<<"Press any key to continue...";
  1284.         getch();
  1285.         return ;
  1286.     }
  1287.     do
  1288.     {
  1289.         valid = 1;
  1290.         gotoxy(1,25); clreol();
  1291.         gotoxy(1,25);
  1292.         cout<<"ENTER THE NAME OF THE CUSTOMER";
  1293.         gotoxy(20,4);
  1294.         gets(t_name);
  1295.         strupr(t_name);
  1296.         fflush(stdin);
  1297.         if ((strlen(t_name) <=0 || (strlen(t_name) > 20 )));
  1298.         {
  1299.             valid = 0;
  1300.             sound(500);
  1301.             delay(100);
  1302.             nosound();
  1303.             gotoxy(1,25); clreol();
  1304.             gotoxy(1,24);
  1305.             cout<<"LENGTH SHOULD NOT BE ZERO OR GREATER THAN 20";
  1306.             gotoxy(1,25);
  1307.             cout<<"Press any key to continue...";
  1308.             getch();
  1309.             gotoxy(1,24); clreol();
  1310.             gotoxy(1,25); clreol();
  1311.             gotoxy(20,4); clreol();
  1312.         }
  1313.     } while(!valid);
  1314.     do
  1315.     {
  1316.         valid = 1;
  1317.         gotoxy(1,25); clreol();
  1318.         gotoxy(1,25);
  1319.         cout<<"ENTER THE NO. OF THE GUEST WITH THE CUSTOMER";
  1320.         gotoxy(20,5);
  1321.         cin>>t_no_cust;
  1322.         if ((t_no_cust < 0) || (t_no_cust > 4))
  1323.         {
  1324.             valid = 0;
  1325.             sound(500);
  1326.             delay(100);
  1327.             nosound();
  1328.             gotoxy(1,25); clreol();
  1329.             gotoxy(1,24);
  1330.             cout<<"GUEST SHOULD NOT BE LESS THAN 0 OR";
  1331.             cout<<"GREATER THAN 4";
  1332.             gotoxy(1,25);
  1333.             cout<<"Press Any key to continue...";
  1334.             getch();
  1335.             gotoxy(1,24); clreol();
  1336.             gotoxy(1,25); clreol();
  1337.             gotoxy(20,5); clreol();
  1338.         }
  1339.     } while (!valid);
  1340.     do
  1341.     {
  1342.         valid = 1;
  1343.         gotoxy(1,25); clreol();
  1344.         gotoxy(1,25);
  1345.         cout<<"ENTER THE ADDRESS OF THE CUSTOMER";
  1346.         gotoxy(20,6);
  1347.         gets(t_address);
  1348.         fflush(stdin);
  1349.         if ((strlen(t_address) <= 0 || (strlen(t_address) > 50)));
  1350.         {
  1351.             valid = 0;
  1352.             sound(500);
  1353.             delay(100);
  1354.             nosound();
  1355.             gotoxy(1,25); clreol();
  1356.             gotoxy(1,24);
  1357.             cout<<"LENGTH SHOULD NOT BE ZERO OR GREATER THAN 50";
  1358.             gotoxy(1,25);
  1359.             cout<<"Press Any key to continue...";
  1360.             getch();
  1361.             gotoxy(1,24); clreol();
  1362.             gotoxy(1,25); clreol();
  1363.             gotoxy(20,6); clreol();
  1364.         }
  1365.     } while (!valid);
  1366.     do
  1367.     {
  1368.         valid = 2;
  1369.         gotoxy(1,25); clreol();
  1370.         gotoxy(1,25);
  1371.         cout<<"ENTER THE PHONE NO. OF THE CUSTOMER, ENTER '-' FOR";
  1372.         cout<<"NO PHONE NO.";
  1373.         gotoxy(20,7);
  1374.         cin>>t_phone;
  1375.         if ((strlen(t_phone) < 7 && strlen(t_phone) > 1 || (strlen(t_phone) > 7)));
  1376.         {
  1377.             valid = 0;
  1378.             sound(500);
  1379.             delay(100);
  1380.             nosound();
  1381.             gotoxy(1,25); clreol();
  1382.             gotoxy(1,24);
  1383.             cout<<"LENGTH SHOULD NOT LESS THAN 7 OR GREATER";
  1384.             cout<<"THAN 7";
  1385.             gotoxy(1,25);
  1386.             cout<<"Press Any key to continue...";
  1387.             getch();
  1388.             gotoxy(1,24); clreol();
  1389.             gotoxy(1,25); clreol();
  1390.             gotoxy(20,7); clreol();
  1391.         }
  1392.     } while (!valid);
  1393.     do
  1394.     {
  1395.         valid = 1;
  1396.         gotoxy(1,25); clreol();
  1397.         gotoxy(1,25);
  1398.         cout<<"ENTER NATIONALITY OF THE CUSTOMER";
  1399.         gotoxy(20,8);
  1400.         gets(t_nation);
  1401.         fflush(stdin);
  1402.         if ((strlen(t_nation) <=0 || (strlen(t_nation) > 15 )));
  1403.         {
  1404.             valid = 0;
  1405.             sound(500);
  1406.             delay(100);
  1407.             nosound();
  1408.             gotoxy(1,25); clreol();
  1409.             gotoxy(1,24);
  1410.             cout<<"LENGTH SHOULD NOT LESS THAN ZERO OR GREATER";
  1411.             cout<<"THAN 15";
  1412.             gotoxy(1,25);
  1413.             cout<<"Press Any key to continue...";
  1414.             getch();
  1415.             gotoxy(1,24); clreol();
  1416.             gotoxy(1,25); clreol();
  1417.             gotoxy(20,8); clreol();
  1418.         }
  1419.     } while (!valid);
  1420.     do
  1421.     {
  1422.         valid = 1;
  1423.         gotoxy(1,25); clreol();
  1424.         gotoxy(1,25);
  1425.         cout<<"ENTER PASSPORT NO. OF THE CUSTOMER";
  1426.         gotoxy(20,9);
  1427.         gets(t_passport);
  1428.         fflush(stdin);
  1429.         if ((strlen(t_passport) <=0 || (strlen(t_passport) > 15)));
  1430.         {
  1431.             valid = 0;
  1432.             sound(500);
  1433.             delay(100);
  1434.             nosound();
  1435.             gotoxy(1,25); clreol();
  1436.             gotoxy(1,24);
  1437.             cout<<"LENGTH SHOULD NOT LESS THAN ZERO OR GREATER";
  1438.             cout<<"THAN 15";
  1439.             gotoxy(1,25);
  1440.             cout<<"Press Any key to continue...";
  1441.             getch();
  1442.             gotoxy(1,24); clreol();
  1443.             gotoxy(1,25); clreol();
  1444.             gotoxy(20,9); clreol();
  1445.         }
  1446.     } while (!valid);
  1447.     do
  1448.     {
  1449.         valid = 1;
  1450.         gotoxy(1,25); clreol();
  1451.         gotoxy(1,25);
  1452.         cout<<"ENTER THE ADVANCE RS.";
  1453.         gotoxy(20,11);
  1454.         cin>>t_advance;
  1455.         if (t_advance < 0)
  1456.         {
  1457.             valid = 0;
  1458.             sound(500);
  1459.             delay(100);
  1460.             nosound();
  1461.             gotoxy(1,25); clreol();
  1462.             gotoxy(1,24);
  1463.             cout<<"SHOULD NOT LESS THAN ZERO";
  1464.             gotoxy(1,25);
  1465.             cout<<"Press Any key to continue...";
  1466.             getch();
  1467.             gotoxy(1,24); clreol();
  1468.             gotoxy(1,25); clreol();
  1469.             gotoxy(20,11); clreol();
  1470.         }
  1471.     } while (!valid);
  1472.     do
  1473.     {
  1474.         valid = 1;
  1475.         gotoxy(1,25); clreol();
  1476.         gotoxy(1,25);
  1477.         cout<<"ENTER MISCALLLENIOUS CHARGE";
  1478.         gotoxy(20,12);
  1479.         cin>>t_misc;
  1480.         if (t_misc < 0)
  1481.         {
  1482.             valid = 0;
  1483.             sound(500);
  1484.             delay(100);
  1485.             nosound();
  1486.             gotoxy(1,25); clreol();
  1487.             gotoxy(1,24);
  1488.             cout<<"SHOULD NOT LESS THAN ZERO";
  1489.             gotoxy(1,25);
  1490.             cout<<"Press Any key to continue...";
  1491.             getch();
  1492.             gotoxy(1,24); clreol();
  1493.             gotoxy(1,25); clreol();
  1494.             gotoxy(20,12); clreol();
  1495.         }
  1496.     } while (!valid);
  1497.     do
  1498.     {
  1499.         valid = 1;
  1500.         gotoxy(1,25); clreol();
  1501.         gotoxy(1,25);
  1502.         cout<<"ENTER THE ROOM SERVICE CHARGE";
  1503.         gotoxy(20,13);
  1504.         cin>>t_room_srv;
  1505.         if (t_room_srv < 0)
  1506.         {
  1507.             valid = 0;
  1508.             sound(500);
  1509.             delay(100);
  1510.             nosound();
  1511.             gotoxy(1,25); clreol();
  1512.             gotoxy(1,24);
  1513.             cout<<"SHOULD NOT LESS THAN ZERO";
  1514.             gotoxy(1,25);
  1515.             cout<<"Press Any key to continue...";
  1516.             getch();
  1517.             gotoxy(1,24); clreol();
  1518.             gotoxy(1,25); clreol();
  1519.             gotoxy(20,13); clreol();
  1520.         }
  1521.     } while (!valid);
  1522.     gotoxy(1,15);
  1523.     cout<<"Do you want to save the record (y/n) : ";
  1524.     do
  1525.     {
  1526.         valid = 1;
  1527.         gotoxy(42,15);
  1528.         ch = getch();
  1529.         ch = toupper(ch);
  1530.         if (ch != 'r' && ch != 'N')
  1531.         {
  1532.             valid = 1;
  1533.             sound(500);
  1534.             delay(100);
  1535.             nosound();
  1536.             gotoxy(42,15); clreol();
  1537.         }
  1538.     } while (!valid);
  1539.     if (ch =='Y')
  1540.         r.change_status(t_roomno, '0');
  1541.         roomno = t_roomno;
  1542.         strcpy(name,t_name);
  1543.         strcpy(phone,t_phone);
  1544.         advance = t_advance;
  1545.         misc = t_misc;
  1546.         room_srv = t_room_srv;
  1547.         fstream file;
  1548.         file.open("CUSTOMER.TXT", ios::out | ios::app);
  1549.         file.write((char*) this , sizeof(customer));
  1550.         file.close();
  1551.     }
  1552.  
  1553. void customer :: display_record(int t_roomno)
  1554. {
  1555.     fstream file;
  1556.     file.open("CUSTOMER.TXT", ios::in);
  1557.     file.seekg(0);
  1558.     int found = 0;
  1559.     while (file.read((char *) this, sizeof(customer)) && !found)
  1560.     {
  1561.         if (t_roomno == roomno)
  1562.         {
  1563.             found = 1;
  1564.             gotoxy(1,5);
  1565.             cout<<"Room no.             : "<<roomno;
  1566.             gotoxy(1,6);
  1567.             cout<<"Customer Name        : "<<name;
  1568.             gotoxy(1,7);
  1569.             cout<<"Phone no.            : "<<phone;
  1570.             gotoxy(1,8);
  1571.             cout<<"Advance              : "<<advance;
  1572.             gotoxy(1,9);
  1573.             cout<<"Misc. charge         : "<<misc;
  1574.             gotoxy(1,10);
  1575.             cout<<"Room Service Charge  : "<<room_srv;
  1576.         }
  1577.     }
  1578.     file.close();
  1579. }
  1580. int customer :: recordno(int t_roomno)
  1581. {
  1582.     fstream file;
  1583.     file.open("CUSTOMER.TXT", ios::in);
  1584.     file.seekg(0);
  1585.     int count = 0;
  1586.     while (file.read((char *) this, sizeof(customer)));
  1587.     {
  1588.         count++;
  1589.         if (t_roomno == roomno);
  1590.  
  1591.     }
  1592.     file.close();
  1593.     return count;
  1594. }
  1595. void customer :: modify(void)
  1596. {
  1597.     clrscr();
  1598.     room r;
  1599.     int valid;
  1600.     char ch;
  1601.     int t_roomno, tr;
  1602.     char t_name[21], t_phone[8];
  1603.     float t_advance, t_misc, t_room_srv;
  1604.     fstream file;
  1605.     file.open("CUSTOMER.TXT", ios::out | ios::ate);
  1606.     gotoxy(1,3);
  1607.     cout<<"Enter the Room no. of the customerto be modified ";
  1608.     cin>>t_roomno;
  1609.     char t_status;
  1610.     t_status = r.room_status(tr);
  1611.     if (!r.room_found(tr) || t_status == 'V')
  1612.     {
  1613.         sound(500);
  1614.         delay(100);
  1615.         nosound();
  1616.         gotoxy(1,25); clreol();
  1617.         gotoxy(1,24);
  1618.         cout<<"ROOM NO. NOT FOUND OR ROOM IS VACANT";
  1619.         gotoxy(1,25);
  1620.         cout<<"Press Any key to continue...";
  1621.         getch();
  1622.         return;
  1623.     }
  1624.     display_record(tr);
  1625.     gotoxy(1,12);
  1626.     cout<<"Do you want to modify this room Record (y/n) : ";
  1627.     do
  1628.     {
  1629.         valid = 1;
  1630.         gotoxy(48,12);
  1631.         ch = getch();
  1632.         ch = toupper(ch);
  1633.         if (ch != 'Y' && ch != 'N')
  1634.         {
  1635.             valid = 0;
  1636.             sound(500);
  1637.             delay(100);
  1638.             nosound();
  1639.         gotoxy(42,12); clreol();
  1640.         }
  1641.     } while (!valid);
  1642.     do
  1643.     {
  1644.     if (ch == 'N')
  1645.         return;
  1646.     gotoxy(1,14);
  1647.     cout<<"Enter THE NEW DATA OF THE CUSTOMER";
  1648.     gotoxy(1,16);
  1649.     cout<<"Room no.         : ";
  1650.     gotoxy(1,17);
  1651.     cout<<"Name             : ";
  1652.     gotoxy(1,18);
  1653.     cout<<"Phone            : ";
  1654.     gotoxy(1,19);
  1655.     cout<<"Advance          : ";
  1656.     gotoxy(1,20);
  1657.     cout<<"Miscellineous    : ";
  1658.     gotoxy(1,21);
  1659.     cout<<"Room service     : ";
  1660.  
  1661.     {
  1662.         valid = 1;
  1663.         gotoxy(1,25); clreol();
  1664.         gotoxy(1,25);
  1665.         cout<<"ENTER THE ROOM NUMBER FOR THE CUSTOMER";
  1666.         gotoxy(20,16);
  1667.         cin>>t_roomno;
  1668.         t_status = r.room_status(t_roomno);
  1669.         if ((!r.room_found(t_roomno)) || (r.room_found(t_roomno)&& t_roomno != tr && t_status == '0'));
  1670.         {
  1671.             valid = 0;
  1672.             sound(500);
  1673.             delay(100);
  1674.             nosound();
  1675.             gotoxy(1,25); clreol();
  1676.             gotoxy(1,24);
  1677.             cout<<"ROOM NO. NOT EXIST OR NOT VACANT";
  1678.             gotoxy(1,25);
  1679.             cout<<"Press Any key to continue...";
  1680.             getch();
  1681.             gotoxy(1,24); clreol();
  1682.             gotoxy(1,25); clreol();
  1683.             gotoxy(20,16); clreol();
  1684.         }
  1685.     } while (!valid)
  1686.     do
  1687.     {
  1688.         valid = 1;
  1689.         gotoxy(1,25); clreol();
  1690.         gotoxy(1,25);
  1691.         cout<<"ENTER THE NAME OF THE CUSTOMER";
  1692.         gotoxy(20,17);
  1693.         gets(t_name);
  1694.     strupr(t_name);
  1695.     fflush(stdin);
  1696.     if ((strlen(t_name) <=0 || (strlen(t_name) > 20 )));
  1697.     {
  1698.         valid = 0;
  1699.         sound(500);
  1700.         delay(100);
  1701.         nosound();
  1702.         gotoxy(1,25); clreol();
  1703.         gotoxy(1,24);
  1704.         cout<<"LENGTH SHOULD NOT BE ZERO OR GREATER THAN 20";
  1705.         gotoxy(1,25);
  1706.         cout<<"Press Any key to continue...";
  1707.         getch();
  1708.         gotoxy(1,24); clreol();
  1709.         gotoxy(1,25); clreol();
  1710.         gotoxy(20,17); clreol();
  1711.     }
  1712. } while (!valid);
  1713. do
  1714. {
  1715.     valid = 1;
  1716.     gotoxy(1,25); clreol();
  1717.     gotoxy(1,25);
  1718.     cout<<"ENTER THE PHONE NO. OF THE CUSTOMER, ENTER '-' FOR";
  1719.     cout<<"NO PHONE NO,";
  1720.     gotoxy(20,18);
  1721.     cin>>t_phone;
  1722.     if ((strlen(t_phone) < 7 && strlen(t_phone) > 1 || (strlen(t_phone) > 7)));
  1723.         {
  1724.             valid = 0;
  1725.             sound(500);
  1726.             delay(100);
  1727.             nosound();
  1728.             gotoxy(1,25); clreol();
  1729.             gotoxy(1,24);
  1730.             cout<<"LENGTH SHOULD NOT BE LESS THAN 7 OR GREATER";
  1731.             cout<<"THAN 7";
  1732.             gotoxy(1,25);
  1733.             cout<<"Press Any key to continue...";
  1734.             getch();
  1735.             gotoxy(1,24); clreol();
  1736.             gotoxy(1,25); clreol();
  1737.             gotoxy(20,18); clreol();
  1738.     }
  1739. }
  1740. while (!valid);
  1741. do
  1742. {
  1743.     valid = 1;
  1744.     gotoxy(1,25); clreol();
  1745.     gotoxy(1,25);
  1746.     cout<<"ENTER THE ADVANCE RS.";
  1747.     gotoxy(20,19);
  1748.     cin>>t_advance;
  1749.     if (t_advance < 0)
  1750.     {
  1751.         valid = 0;
  1752.         sound(500);
  1753.         delay(100);
  1754.         nosound();
  1755.         gotoxy(1,25); clreol();
  1756.         gotoxy(1,24);
  1757.         cout<<"SHOULD NOT LESS THAN ZERO";
  1758.         gotoxy(1,25);
  1759.         cout<<"Press Any key to continue...";
  1760.         getch();
  1761.         gotoxy(1,24); clreol();
  1762.         gotoxy(1,25); clreol();
  1763.         gotoxy(20,19); clreol();
  1764.     }
  1765. } while (!valid);
  1766. do
  1767. {
  1768.     valid = 1;
  1769.     gotoxy(1,25); clreol();
  1770.     gotoxy(1,25);
  1771.     cout<<"ENTER THE MISCALLLENIOUS CHARGES";
  1772.     gotoxy(20,20);
  1773.     cin>>t_misc;
  1774.     if (t_misc < 0);
  1775.     {
  1776.         valid = 0;
  1777.         sound(500);
  1778.         delay(100);
  1779.         nosound();
  1780.         gotoxy(1,25); clreol();
  1781.         gotoxy(1,24);
  1782.         cout<<"SHOULD NOT LESS THAN ZERO";
  1783.         gotoxy(1,25);
  1784.         cout<<"Press Any key to continue...";
  1785.         getch();
  1786.         gotoxy(1,24); clreol();
  1787.         gotoxy(1,25); clreol();
  1788.         gotoxy(20,20); clreol();
  1789.     }
  1790. } while (!valid);
  1791. do
  1792. {
  1793.     valid = 1;
  1794.     gotoxy(1,25); clreol();
  1795.     gotoxy(1,25);
  1796.     cout<<"ENTER THE ROOM SERVICE CHARGES";
  1797.     gotoxy(20,21);
  1798.     cin>>t_room_srv;
  1799.     if (t_room_srv < 0);
  1800.     {
  1801.         valid = 0;
  1802.             sound(500);
  1803.             delay(100);
  1804.             nosound();
  1805.             gotoxy(1,25); clreol();
  1806.             gotoxy(1,24);
  1807.             cout<<"SHOULD NOT LESS THAN ZERO";
  1808.             gotoxy(1,25);
  1809.             cout<<"Press Any key to continue...";
  1810.             getch();
  1811.             gotoxy(1,24); clreol();
  1812.             gotoxy(1,25); clreol();
  1813.             gotoxy(20,21); clreol();
  1814.         }
  1815.     } while (!valid);
  1816.     do
  1817.     {
  1818.     cout<<"Do you want to save the record (y/n) : ";
  1819.     gotoxy(1,23);
  1820.  
  1821.         valid = 1;
  1822.         gotoxy(42,23);
  1823.         ch = getch();
  1824.         ch = toupper(ch);
  1825.         if (ch != 'Y' && ch != 'N')
  1826.         {
  1827.             valid = 0;
  1828.             sound(500);
  1829.             delay(100);
  1830.             nosound();
  1831.             gotoxy(42,23); clreol();
  1832.         }
  1833.     } while (!valid);
  1834.     if (ch=='Y')
  1835.     {
  1836.         if (t_roomno !=tr)
  1837.         {
  1838.             r.change_status(t_roomno, '0');
  1839.             r.change_status(tr, 'V');
  1840.         }
  1841.         int recno;
  1842.         recno = recordno(tr);
  1843.         int location;
  1844.         location = (recno-1) * sizeof(customer);
  1845.         file.seekg(location);
  1846.         roomno = t_roomno;
  1847.         strcpy(name,t_name);
  1848.         strcpy(phone,t_phone);
  1849.         room_srv = t_room_srv;
  1850.         advance = t_advance;
  1851.         misc = t_misc;
  1852.         file.write((char *) this, sizeof(customer));
  1853.     {
  1854.     file.close();
  1855. }
  1856. void customer :: delete_record(int t_roomno)
  1857. {
  1858.     fstream file;
  1859.     file.open("CUSTOMER.TXT", ios::in);
  1860.     fstream temp;
  1861.     temp.open ("temp.txt", ios::out);
  1862.     while (!file.eof())
  1863.     {
  1864.         file.read((char *) this, sizeof(customer));
  1865.         if ( file.eof())
  1866.             break;
  1867.         if ( roomno != t_roomno)
  1868.             temp.write((char *) this, sizeof(customer));
  1869.     }
  1870.     file.close();
  1871.     temp.close();
  1872.     file.open("CUSTOMER.TXT", ios::out);
  1873.     temp.open("temp.txt", ios::in);
  1874.     temp.seekg(0);
  1875.     while (!temp.eof())
  1876.     {
  1877.         temp.read((char *) this, sizeof(customer));
  1878.         if (temp.eof())
  1879.             break;
  1880.         file.write((char *) this, sizeof(customer));
  1881.     }
  1882.     file.close();
  1883.     temp.close();
  1884. }
  1885.  
  1886. void customer :: display_customer_record(void)
  1887. {
  1888.         clrscr();
  1889.         room r;
  1890.         int valid;
  1891.         int t_roomno;
  1892.         gotoxy(1,3);
  1893.         cout<<"Enter the roomm no. of the customer : " ;
  1894.         cin>>t_roomno;
  1895.         char t_status;
  1896.         t_status = r.room_status(t_roomno);
  1897.         if (!r.room_found(t_roomno) || t_status == 'V')
  1898.         {
  1899.             sound(500);
  1900.             delay(100);
  1901.             nosound();
  1902.             gotoxy(1,25); clreol();
  1903.             gotoxy(1,24);
  1904.             cout<<"ROOM NO. NOT FOUND OR ROOM IS VACANT";
  1905.             gotoxy(1,25);
  1906.             cout<<"Press Any key to continue...";
  1907.             getch();
  1908.         return 0;
  1909.     }
  1910.     clrscr();
  1911.     gotoxy(5,3);
  1912.     cout<<"CUSTOMER RECORD";
  1913.     display_record(t_roomno);
  1914.     gotoxy(1,25);
  1915.     cout<<"Press any key to continue...";
  1916.     getch();
  1917. }
  1918.  
  1919. void customer :: deletion(void)
  1920. {
  1921.         clrscr();
  1922.         room r;
  1923.         int valid;
  1924.         char ch;
  1925.         int t_roomno;
  1926.         gotoxy(1,3);
  1927.         cout<<"Enter the Roomm no. of the customer to be deleted: " ;
  1928.         cin>>t_roomno;
  1929.         char t_status;
  1930.         t_status = r.room_status(t_roomno);
  1931.         if (!r.room_found(t_roomno) || t_status == 'V')
  1932.         {
  1933.             sound(500);
  1934.             delay(100);
  1935.             nosound();
  1936.             gotoxy(1,25); clreol();
  1937.             gotoxy(1,24);
  1938.             cout<<"ROOM NO. NOT FOUND OR ROOM IS VACANT";
  1939.             gotoxy(1,25);
  1940.             cout<<"Press Any key to continue...";
  1941.             getch();
  1942.             return;
  1943.         }
  1944.         display_record(t_roomno);
  1945.         gotoxy(1,15);
  1946.         ch = getche();
  1947.         ch = toupper(ch);
  1948.         if (ch != 'Y' && ch != 'N')
  1949.         {
  1950.             valid = 0;
  1951.             sound(500);
  1952.             delay(100);
  1953.             nosound();
  1954.             gotoxy(52,15); clreol();
  1955.         }
  1956.     } while (!valid)
  1957.     if (ch == 'N');
  1958.         return;
  1959.     r.change_status(t_roomno,'V');
  1960.     delete_record(t_roomno);
  1961. }
  1962.  
  1963. void customer::checkout(void)
  1964. {
  1965.         clrscr();
  1966.         room r;
  1967.         int valid;
  1968.         char ch;
  1969.         int t_roomno;
  1970.         gotoxy(1,3);
  1971.         cout<<"Enter the Roomm no. of the customer to be checkout: " ;
  1972.         cin>>t_roomno;
  1973.         char t_status;
  1974.         t_status = r.room_status(t_roomno);
  1975.         if (!r.room_found(t_roomno) || t_status == 'V')
  1976.         {
  1977.             sound(500);
  1978.             delay(100);
  1979.             nosound();
  1980.             gotoxy(1,25); clreol();
  1981.             gotoxy(1,24);
  1982.             cout<<"ROOM NO. NOT FOUND OR ROOM IS VACANT";
  1983.             gotoxy(1,25);
  1984.             cout<<"Press Any key to continue...";
  1985.             getch();   
  1986.             return 0;
  1987.         }
  1988.         display_record(t_roomno);
  1989.         gotoxy(1,15);
  1990.         cout<<"Do you want to prepare bill of this customer record (y/n) :";
  1991.         do
  1992.         {
  1993.             valid = 1;
  1994.             gotoxy(63,15);
  1995.             ch = getch();
  1996.             ch = toupper(ch);
  1997.             if (ch != 'Y' && ch != 'N')
  1998.             {
  1999.                 valid = 0;
  2000.                 sound(500);
  2001.                 delay(100);
  2002.                 nosound();
  2003.                 gotoxy(63,15); clreol():
  2004.             }
  2005.         {   while (!valid);
  2006.         if (ch =='N')
  2007.             return;
  2008.     fstream file;
  2009.     file.open("CUSTOMER.TXT", ios::in);
  2010.     file.seekg(0);
  2011.     char t_name[21];
  2012.     float t_advance, t_room_srv, t_misc, t_tarriff;
  2013.     while (file.open((char *) this, sizeof(customer)))
  2014.     {
  2015.         if (t_roomno == roomno)
  2016.         {
  2017.             strcpy(t_name,name);
  2018.             t_advance = advance;
  2019.             t_room_srv = room_srv;
  2020.             t_misc = misc;
  2021.             break;
  2022.         }
  2023.     }
  2024.     file.();
  2025.     t_tarriff = r.get_data(t_roomno);
  2026.     account a;
  2027.     a.perpare_bill(t_roomno, t_tarriff, t_name, t_advance, t_room_srv, t_misc);
  2028.     r.change_status(t_roomno, 'V';
  2029.     delete_record(t_roomno);
  2030.     gotoxy(1,25);
  2031.     cout<<"Press any key to continue...";
  2032.     getch();
  2033.    
  2034. }
  2035.  
  2036. void account :: prepare_bill(int t_roomno, float t_tarriff, char t_name[21], float t_advance, float t_room_srv, float t_misc)
  2037. {
  2038.     int valid;
  2039.     int days;
  2040.     float tax, total;
  2041.     gotoxy(1,17);
  2042.     cout<<"Enter the no. of days : ";
  2043.     do
  2044.     {
  2045.         valid = 1;
  2046.         gotoxy(25,17);
  2047.         cin>>days;
  2048.         if (days < 0 || days > 999)
  2049.         {
  2050.             valid = 0;
  2051.             sound(500);
  2052.             delay(100);
  2053.             nosound();
  2054.             gotoxy(1,25); clreol();
  2055.             gotoxy(1,24);
  2056.             cout<<"SHOULD NOT LESS THAN ZERO";
  2057.             gotoxy(1,25);
  2058.             cout<<"Press Any key to continue...";
  2059.             getche();
  2060.             gotoxy(1,24); clreol();
  2061.             gotoxy(1,25); clreol();
  2062.             gotoxy(20,17); clreol();
  2063.         }
  2064.     } while (!valid)
  2065.     t_tarriff = t_tarriff * days;
  2066.     total = (t_room_srv + t_misc + t_tarriff) - t_advance;
  2067.     tax = total * 0.22;
  2068.  c  total = total + tax;
  2069.     clrscr();
  2070.     menu m;
  2071.     m.line_horhor(2,59,1,15);
  2072.     m.line_horhor(2,59,24,15);
  2073.     m.line_ver(1,24,2,15);
  2074.     m.line_ver(1,24,59,15);
  2075.     gotoxy(5,3);
  2076.     cout<<"Bill of Room no.         : "<<t_roomno;
  2077.     gotoxy(5,6);
  2078.     cout<<"Name of the customer     : "<<t_name;
  2079.     gotoxy(5,8);
  2080.     cout<<"Tarrif charges            : "<<t_tarriff;
  2081.     gotoxy(5,10);
  2082.     cout<<"Misc. Charges            : "<<t_misc;
  2083.     gotoxy(5,12);
  2084.     cout<<"Room Service CHARGES      : "<<t_room_srv;
  2085.     gotoxy(5,14);
  2086.     cout<<"Tax                      : "<<tax;
  2087.     gotoxy(5,16);
  2088.     cout<<"Advance                  : "<<advance;
  2089.     gotoxy(5,18);
  2090.     cout<<"-------------------------------------------------------------";
  2091.     gotoxy(5,19);
  2092.     cout<<"Total Bill               :"<<total;
  2093.     gotoxy(5,20);
  2094.     cout<<"--------------------------------------------------------------";
  2095. }
  2096.  
  2097. void menu :: graphics_function(void)
  2098. {
  2099.     int driver=DETECT,mode;
  2100.     initgraph(&driver,&mode,"c:\\tc\\bgi");
  2101.     setbkcolor(WHITE);
  2102.     for(int p=0; p<1000; p=p+25)
  2103.     {
  2104.         sound (p);
  2105.         delay(50);
  2106.         nosound();
  2107.     }
  2108.     setcolor(1);
  2109.     settextstyle(4,0,7);
  2110.     outtextxy(90,60, "WELCOME TO");
  2111.     outtextxy(30,150,"HOTEL BOOKING");
  2112.     outtextxy(150,250, "PAYMENT");
  2113.     outtextxy(155,350, "SYSTEM");
  2114.     getch();
  2115.     closegraph();
  2116.     clrscr();
  2117. }
  2118.  
  2119. void menu :: circle_function(void)
  2120. {
  2121.     int driver=DETECT,mode;
  2122.     initgraph(&driver,&mode,"c:\\tc\\bgi");
  2123.     for(int l=0; l<1500; l++)
  2124.     {
  2125.         setcolor(15);
  2126.         putpixel (random(700), random(500), l);
  2127.         delay(2);
  2128.     }
  2129.     settextstyle(10,0,3);
  2130.     outtextxy(10,5, "File Organization COS216");
  2131.     settextstyle(4,0,4);
  2132.     for (int t=0; t<300, t++;
  2133.     {
  2134.         outtextxy(t,40),"----");
  2135.         delay(5);
  2136.     }
  2137.     for (int o=500; o<6500; =o+250?)
  2138.     {
  2139.         sound(0);
  2140.         delay(70);
  2141.         nosound();
  2142.     }
  2143.     for (int i=10; i<=67; i++)
  2144.     {
  2145.         settextstyle(4,0,9);
  2146.         outtextxy(0,50, "HOTEL");
  2147.         outtextxy(0,150, "BOOKING");
  2148.         outtextxy(0,250, "PAYMENT");
  2149.         outtextxy(0,350, "SYSTEM");
  2150.     }
  2151.     getch();
  2152.     closegraph();
  2153.     clrscr();
  2154. }
  2155.  
  2156. void menu :: close_function(void)
  2157. {
  2158.     int driver=DETECT,mode;
  2159.     initgraph(&driver,&mode,"c:\\tc\\bgi");
  2160.     settextstyle(4,0,8);
  2161.     setcolor(15);
  2162.     outtextxy(80,170, "THANK YOU");
  2163.     for (int f=0; f<=5000; f=f+350)
  2164.     {
  2165.         delay(60);
  2166. //      sound(f), delay(50);
  2167.         nosound();
  2168.     }
  2169.     getch();
  2170. }
  2171.  
  2172. void main(void)
  2173. {
  2174.     menu
  2175. //  m.enter_password();
  2176.     m.circle_function();
  2177.     m.graphics_function();
  2178.     m.main_menu();
  2179.     m.close_function();
  2180.  
  2181. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement