fork download
  1.  
  2. //***********************************************
  3. // PROJECT HOTEL-MANAGEMENT
  4. //***********************************************
  5.  
  6.  
  7. //****************************
  8. // INCLUDED HEADER FILES
  9. //****************************
  10.  
  11.  
  12.  
  13. #include<iostream>
  14. #include<string.h>
  15. #include<graphics.h>
  16. #include<dos.h>
  17. #include<stdio.h>
  18. #include<fstream.h>
  19. #include<iomanip.h>
  20. #include<stdlib.h>
  21.  
  22.  
  23. //********************************************
  24. // THIS CLASS CONTAINS FUNTIONS FOR FOOD
  25. //********************************************
  26.  
  27.  
  28. class food
  29. {
  30. private:
  31. fstream p1;
  32. int c;
  33. char ap;
  34. struct fd
  35. {
  36. char name[55];
  37. float price;
  38. }f;
  39. public:
  40. food()
  41. {
  42. c=0;
  43. }
  44. void food_menu(void);
  45. void app_fmenu(void);
  46. void food_bill();
  47. void del_all();
  48. };
  49. //*****************************************************
  50. // FUNCTION FOR DISPLAYING FOOD MENU
  51. //*****************************************************
  52.  
  53. void food::food_menu(void)
  54. {
  55. cleardevice();
  56. setfillstyle(7,1);
  57. floodfill(0,0,4);
  58. setfillstyle(7,10);
  59. bar(17,40,605,420);
  60. rectangle(17,40,605,420);
  61. setfillstyle(1,10);
  62. bar(24,47,598,413);
  63. rectangle(24,47,598,413);
  64. p1.close();
  65. c=0;
  66. p1.open("food.txt",ios::in|ios::binary);
  67. outtextxy(30,50,"S.N. ITEM NAME PRICE");
  68. gotoxy(4,5);
  69. char h[5],pr[15];
  70. while(p1.read((char*)&f,sizeof(f)))
  71. {
  72. c++;
  73. settextstyle(4,0,1);
  74. itoa(c,h,10);
  75. outtextxy(40,60+20*c,h);
  76. outtextxy(150,60+20*c,f.name);
  77. itoa(f.price,pr,10);
  78. outtextxy(390,60+20*c,pr);
  79. }//END OF WHILE
  80. p1.close();
  81. settextstyle(15,0,1);
  82. outtextxy(30,325,"DO YOU WANT TO ADD AN ITEM - (Y/N)");
  83. gotoxy(60,20);
  84. cin>>ap;
  85. if(ap=='y'||ap=='Y')
  86. {
  87. app_fmenu();
  88. //CALLING APPEND FUNCTION
  89. }
  90. else
  91. {
  92. if(ap=='n'||ap=='N')
  93. {
  94. outtextxy(30,360,"DO YOU WANT TO DELETE ALL (Y/N)");
  95. char ch;
  96. gotoxy(60,23);
  97. cin>>ch;
  98. if(ch=='y'||ch=='Y')
  99. {
  100. del_all();
  101. //CALLING DELETE FUNCTION
  102. }
  103. }
  104. }
  105. }
  106.  
  107. //***************************************
  108. // FUNCTION TO APPEND IN FOOD MENU
  109. //***************************************
  110.  
  111. void food::app_fmenu(void)
  112. {
  113. p1.open("food.txt",ios::app|ios::binary);
  114. outtextxy(30,360,"ENTER ITEM NAME U WANTTO ADD");
  115. gotoxy(60,23);
  116. gets(f.name);
  117. outtextxy(30,380,"ENTER THE PRICE");
  118. gotoxy(60,24);
  119. cin>>f.price;
  120. p1.write((char*)&f,sizeof(f));
  121. p1.close();
  122. getch();
  123. }
  124.  
  125. //*****************************
  126. // FUNCTION FOR FOOD BILL
  127. //*****************************
  128.  
  129. void food::food_bill()
  130. {
  131. double bill=-1;
  132. char c_name[20],f_name[20];
  133. int dt;
  134. cleardevice();
  135. setfillstyle(7,1);
  136. floodfill(0,0,4);
  137. setfillstyle(7,10);
  138. bar(17,40,605,420);
  139. rectangle(17,40,605,420);
  140. setfillstyle(1,7);
  141. bar(24,47,598,413);
  142. rectangle(24,47,598,413);
  143. setcolor(4);
  144. settextstyle(7,0,1);
  145. outtextxy(30,70,"ENTER CUSTOMER NAME ");
  146. gotoxy(50,6);
  147. cin>>c_name;
  148. outtextxy(30,120,"ENTER ITEM NAME TAKEN");
  149. gotoxy(50,9);
  150. cin>>f_name;
  151. outtextxy(30,170,"ENTER THE QUANTITY");
  152. gotoxy(50,12);
  153. cin>>dt;
  154. p1.close();
  155. p1.open("food.txt",ios::in|ios::binary);
  156. while(p1.read((char*)&f,sizeof(f)))
  157. {
  158. if(strcmp(f.name,f_name)==0)
  159. {
  160. bill=dt*f.price;
  161. }
  162. }//END OF WHILE
  163. if(bill==-1)
  164. {
  165. setcolor(1);
  166.  
  167. for(int i=0;i<20;i++)
  168. {
  169. setcolor(1);
  170. outtextxy(30,220,"ITEM IS NOT PRESENT");
  171. delay(100);
  172. setcolor(WHITE);
  173. outtextxy(30,220,"ITEM IS NOT PRESENT");
  174. delay(100);
  175. // delay(2500);
  176. }
  177. }
  178. else
  179. {
  180. char t[5],b[5];
  181. setcolor(1);
  182. itoa(dt,t,10);
  183. itoa(bill,b,10);
  184. outtextxy(30,250,"NAME FOOD.NAME QUANTITY BILL ");
  185. setcolor(1);
  186. settextstyle(4,0,1);
  187. outtextxy(30,280,c_name);
  188. outtextxy(140,280,f_name);
  189. outtextxy(320,280,t);
  190. outtextxy(445,280,b);
  191. getch();
  192. }
  193. }
  194. //************************************
  195. // FUNCTION TO DELETE FOOD MENU
  196. //******************************
  197. void food::del_all()
  198. {
  199. remove("food.txt");
  200. p1.open("food.txt",ios::out);
  201. p1.close();
  202. c=0;
  203. }
  204.  
  205.  
  206. //END OF CLASS FOOD
  207.  
  208. //***************************************
  209. // THIS CLASS CONTAINS INFORMATION
  210. // RELATED TO CUSTOMER
  211. //***************************************
  212.  
  213.  
  214. class customer
  215. {
  216. private:
  217. int q,w;
  218. fstream f1;
  219. struct cust
  220. {
  221. int c_no;
  222. char c_name[20];
  223. char c_add[80];
  224. int a_date;
  225. int a_month;
  226. int a_year;
  227. int d_date;
  228. int d_month;
  229. int d_year;
  230. int room_no;
  231. char room_type[25];
  232. }p;
  233. public:
  234. food j;
  235.  
  236. customer()
  237. {
  238. p.c_no=0;
  239. p.d_date=0;
  240. p.d_month=0;
  241. }
  242.  
  243. //**********************************
  244. // FUNCTION FOR CUSTOMER BILL
  245. //*****************************
  246.  
  247. inline void customer::cust_bill()
  248. {
  249. int cho;
  250. do
  251. {
  252. cleardevice();
  253. f1.close();
  254. setfillstyle(7,1);
  255. floodfill(0,0,4);
  256. setfillstyle(7,10);
  257. bar(10,70,600,450);
  258. rectangle(10,70,600,450);
  259. setfillstyle(1,7);
  260. bar(17,77,593,443);
  261. rectangle(17,77,593,443);
  262. setcolor(5);
  263. setfillstyle(1,2);
  264. settextstyle(7,0,1);
  265. setcolor(9);
  266. setfillstyle(1,2);
  267. bar(210,140,410,238);
  268. rectangle(210,140,410,158);
  269. rectangle(210,140,410,174);
  270. rectangle(210,140,410,190);
  271. rectangle(210,140,410,206);
  272. rectangle(210,140,410,222);
  273. rectangle(210,140,410,238);
  274. setcolor(4);
  275. settextstyle(1,0,4);
  276. outtextxy(180,20,"HOTEL BILL");
  277. line(180,60,383,60);
  278. setcolor(4);
  279. settextstyle(1,0,1);
  280. outtextxy(210,137," 1. ROOM BILL");
  281. outtextxy(210,170," 2. FOOD BILL");
  282. outtextxy(210,200," 3. MAIN MENU");
  283. outtextxy(63,318,"ENTER CHOICE FOR WHICH YOU WANT THE BILL");
  284. gotoxy(67,21);
  285. cin>>cho;
  286. choose(cho);
  287. }while(cho!=3);//END OF WHILE
  288. }
  289.  
  290. void choose(int a)
  291. {
  292. switch(a)
  293. {
  294.  
  295.  
  296. case 1:
  297. {
  298. room_bill();
  299. break;
  300. }
  301. case 2:
  302. {
  303. j.food_bill();
  304. break;
  305. }
  306. case 3:
  307. break;
  308. }
  309. }
  310.  
  311. //****************************
  312. // FUNCTION FOR ROOM BILL
  313. //************************
  314.  
  315. void room_bill()
  316. {
  317. double bill;
  318. int days,no,dt,mth;
  319. cleardevice();
  320. setfillstyle(7,1);
  321. floodfill(0,0,4);
  322. setfillstyle(7,10);
  323. bar(17,40,605,420);
  324. rectangle(17,40,605,420);
  325. setfillstyle(1,7);
  326. bar(24,47,598,413);
  327. rectangle(24,47,598,413);
  328. setcolor(4);
  329. settextstyle(7,0,1);
  330. outtextxy(30,70,"ENTER CUSTOMER NO DEPARTING");
  331. gotoxy(50,6);
  332. cin>>no;
  333. outtextxy(30,120,"DATE OF DEPARTURE");
  334. gotoxy(50,9);
  335. cin>>dt;
  336. outtextxy(30,170,"MONTH OF DEPARTURE");
  337. gotoxy(50,12);
  338. cin>>mth;
  339. if(p.a_month>mth)
  340. {bill=0;
  341. }
  342. f1.close();
  343. f1.open("cust.txt",ios::in|ios::binary);
  344. int c=0;
  345. while(f1.read((char*)&p,sizeof(p)))
  346. {
  347. if(p.c_no==no)
  348. { c++;
  349. if(p.a_month==mth)
  350. {
  351. days=dt-p.a_date;
  352. }
  353. else
  354. {
  355. days=(mth-p.a_month)*30+(dt-p.a_date);
  356. }
  357. if(p.room_no<11)
  358. {
  359. char d[5],m[5],h[5],mt[5],dy[5],bl[5];
  360. bill=days*250;
  361. setcolor(4);
  362. outtextxy(30,270," NAME ARRIVAL DEPARTURE DAYS IN BILL ");
  363. setcolor(1);
  364. settextstyle(1,0,1);
  365. outtextxy(40,300,p.c_name);
  366. itoa(p.a_date,d,10);
  367. outtextxy(150,300,d);
  368. outtextxy(160,300,"/");
  369. itoa(p.a_month,m,10);
  370. outtextxy(170,300,m);
  371. itoa(dt,h,10);
  372. outtextxy(270,300,h);
  373. outtextxy(280,300,"/");
  374. itoa(mth,mt,10);
  375. outtextxy(290,300,mt);
  376. itoa(days,dy,10);
  377. outtextxy(405,300,dy);
  378. itoa(bill,bl,10);
  379. outtextxy(515,300,bl);
  380. }
  381. else
  382. {
  383. char d[5],m[5],h[5],mt[5],dy[5],bl[5];
  384. bill=days*150;
  385. setcolor(4);
  386. outtextxy(30,270," NAME ARRIVAL DEPARTURE DAYS IN BILL ");
  387. setcolor(1);
  388. settextstyle(1,0,1);
  389. outtextxy(40,300,p.c_name);
  390. itoa(p.a_date,d,10);
  391. outtextxy(150,300,d);
  392. outtextxy(160,300,"/");
  393. itoa(p.a_month,m,10);
  394. outtextxy(170,300,m);
  395. itoa(dt,h,10);
  396. outtextxy(270,300,h);
  397. outtextxy(280,300,"/");
  398. itoa(mth,mt,10);
  399. outtextxy(290,300,mt);
  400. itoa(days,dy,10);
  401. outtextxy(405,300,dy);
  402. itoa(bill,bl,10);
  403. outtextxy(510,300,bl);
  404. }
  405. f1.close();
  406. int count=1;
  407. f1.open("cust.txt",ios::in| ios::binary);
  408. fstream f2;
  409. while(f1.read((char*)&p,sizeof(p)))
  410. {
  411. if(p.c_no==no)
  412. {
  413. continue;
  414. }
  415. else
  416. {
  417. f2.open("dup.txt",ios::app|ios::binary);
  418. p.c_no=count;
  419. f2.write((char*)&p,sizeof(p));
  420. count++;
  421. f2.close();
  422. }
  423. }//END OF WHILE
  424. remove("cust.txt");
  425. rename("dup.txt","cust.txt");
  426. f1.close();
  427. }
  428. }//END OF WHILE
  429. if(c==0)
  430. { for(int i=0;i<10;i++)
  431. {
  432. settextstyle(1,0,3);
  433. setcolor(4);
  434. outtextxy(150,300,"CUSTOMER IS NOT PRESENT");
  435. delay(100); setcolor(WHITE);
  436. outtextxy(150,300,"CUSTOMER IS NOT PRESENT");
  437. delay(100);
  438. }
  439. }
  440.  
  441.  
  442. getch();
  443. }
  444.  
  445. //**************************************
  446. // FUNCTION TO DISPLAY CUSTOMER DETAIL
  447. //**************************************
  448.  
  449. void cust_detail()
  450. {
  451. int c;
  452. do
  453. {
  454. cleardevice();
  455. setfillstyle(7,1);
  456. floodfill(0,0,4);
  457. setfillstyle(7,10);
  458. bar(50,80,600,470);
  459. rectangle(50,80,600,470);
  460. setfillstyle(1,7);
  461. bar(57,87,593,463);
  462. rectangle(57,87,593,463);
  463. setcolor(9);
  464. setfillstyle(1,2);
  465. bar(210,140,410,254);
  466. rectangle(210,140,410,158);
  467. rectangle(210,140,410,174);
  468. rectangle(210,140,410,190);
  469. rectangle(210,140,410,206);
  470. rectangle(210,140,410,222);
  471. rectangle(210,140,410,238);
  472. rectangle(210,140,410,254);
  473. setcolor(4);
  474. settextstyle(1,0,4);
  475. outtextxy(160,20,"CUSTOMER DETAIL ");
  476. setcolor(14);
  477. line(163,60,475,60);
  478. setcolor(4);
  479. settextstyle(1,0,1);
  480. outtextxy(225,137," CHOICES ARE :-");
  481. setcolor(4);
  482. settextstyle(1,0,1);
  483. outtextxy(210,154," 1. APPEND");
  484. outtextxy(210,170," 2. MODIFY");
  485. outtextxy(210,186," 3. DELETE ");
  486. outtextxy(210,202," 4. DELETE ALL ");
  487. outtextxy(210,218," 5. DISPLAY ");
  488. outtextxy(210,234," 6. MAIN MENU");
  489. setcolor(4);
  490. settextstyle(7,0,2);
  491. outtextxy(210,300,"ENTER CHOICE :- ");
  492. gotoxy(53,20);
  493. cin>>c;
  494. switch(c)
  495. {
  496. case 1:
  497. {
  498. cust_app();
  499. break;
  500. }
  501. case 2:
  502. {
  503. cust_mod();
  504. break;
  505. }
  506. case 3:
  507. {
  508. cust_del();
  509. break;
  510. }
  511. case 4:
  512. {
  513. cust_adel();
  514. break;
  515. }
  516. case 5:
  517. {
  518. cust_disp();
  519. break;
  520. }
  521. }
  522. }while(c!=6);//END OF WHILE
  523. }
  524.  
  525. //***********************************
  526. // FUNCTION TO APPEND CUSTOMER
  527. //***********************************
  528.  
  529. void cust_app()
  530. {
  531. int ten,temp;
  532. cleardevice();
  533. f1.open("cust.txt",ios::app|ios::binary);
  534. f1.seekg(0,ios::end);
  535. ten=f1.tellg()/sizeof(p);
  536. p.c_no=ten+1;
  537. setfillstyle(7,1);
  538. floodfill(0,0,4);
  539. setfillstyle(7,10);
  540. bar(17,50,605,470);
  541. rectangle(17,50,605,470);
  542. setfillstyle(1,7);
  543. bar(24,57,598,463);
  544. rectangle(24,57,598,463);
  545. setcolor(4);
  546. settextstyle(7,0,1);
  547. outtextxy(30,70,"NAME");
  548. gotoxy(50,6);
  549. cin>>p.c_name;
  550. outtextxy(30,120,"ADDRESS");
  551. gotoxy(50,9);
  552. gets(p.c_add);
  553. outtextxy(30,170,"DATE OF ARRIVAL");
  554. gotoxy(50,12);
  555. cin>>p.a_date;
  556. outtextxy(30,220,"MONTH OF ARRIVAL");
  557. gotoxy(50,15);
  558. cin>>p.a_month;
  559. outtextxy(30,270,"YEAR OF ARRIVAL");
  560. gotoxy(50,18);
  561. cin>>p.a_year;
  562. p.room_no=ten+1;
  563. f1.write((char*)&p,sizeof(p));
  564. f1.close();
  565. }
  566.  
  567. //**********************************************
  568. // FUNCTION TO DISPLAY CUSTOMER IN HOTEL
  569. //**********************************************
  570.  
  571. void cust_disp()
  572. {
  573. cleardevice();
  574. f1.close();
  575. setfillstyle(7,1);
  576. floodfill(0,0,4);
  577. setfillstyle(7,10);
  578. bar(20,20,620,450);
  579. rectangle(20,20,620,450);
  580. setfillstyle(1,7);
  581. bar(27,27,613,443);
  582. rectangle(27,27,613,443);
  583. setcolor(4);
  584. setfillstyle(1,2);
  585. settextstyle(7,0,1);
  586. outtextxy(25,40," CUST NO NAME ADDRESS ROOM.NO DATE");
  587. gotoxy(30,3);
  588. int c=0;
  589. f1.open("cust.txt",ios::in|ios::binary);
  590. f1.seekg(0,ios::beg);
  591. char h[5],pr[5],d[5],m[6];
  592. while(f1.read((char*)&p,sizeof(p)))
  593. {
  594. c++;
  595. setcolor(1);
  596. settextstyle(1,0,1);
  597. itoa(p.c_no,h,10);
  598. outtextxy(55,50+20*c,h);
  599. outtextxy(160,50+20*c,p.c_name);
  600. outtextxy(280,50+20*c,p.c_add);
  601. itoa(p.room_no,pr,10);
  602. outtextxy(440,50+20*c,pr);
  603. itoa(p.a_date,d,10);
  604. outtextxy(550,50+20*c,d);
  605. outtextxy(560,50+20*c,"/");
  606. itoa(p.a_month,m,10);
  607. outtextxy(570,50+20*c,m);
  608. }//END OF WHILE
  609. getch();
  610. f1.close();
  611. }
  612.  
  613. //************************************************
  614. // FUNCTION FOR MODIFYING CUSTOMER DETAIL
  615. //************************************************
  616.  
  617. void cust_mod()
  618. {
  619. cleardevice();
  620. f1.close();
  621. setfillstyle(7,1);
  622. floodfill(0,0,4);
  623. setfillstyle(7,10);
  624. bar(10,10,600,470);
  625. rectangle(10,10,600,470);
  626. setfillstyle(1,7);
  627. bar(17,17,593,463);
  628. rectangle(17,17,593,463);
  629. setcolor(9);
  630. setfillstyle(1,2);
  631. setcolor(4);
  632. int no;//,count=0;
  633. outtextxy(30,42,"ENTER CUSTOMER NO TO BE MODIFIED");
  634. gotoxy(65,4);
  635. cin>>no;
  636. f1.open("cust.txt",ios::in|ios::binary);
  637. while(f1.read((char*)&p,sizeof(p)))
  638. {
  639. if(p.c_no==no)
  640. {
  641. f1.close();
  642. int num=sizeof(p)*(no-1);
  643. f1.open("cust.txt",ios::out|ios::ate|ios::binary);
  644. f1.seekp(num,ios::beg);
  645. outtextxy(30,110,"ENTER NEW RECORD ");
  646. outtextxy(30,150,"NAME");
  647. gotoxy(30,11);
  648. cin>>p.c_name;
  649. outtextxy(30,200,"ADDRESS");
  650. gotoxy(30,14);
  651. cin>>p.c_add;
  652. outtextxy(30,250,"DATE");
  653. gotoxy(30,17);
  654. cin>>p.a_date;
  655. outtextxy(30,300,"MONTH");
  656. gotoxy(30,20);
  657. cin>>p.a_month;
  658. outtextxy(30,350,"YEAR");
  659. gotoxy(30,23);
  660. cin>>p.a_year;
  661. f1.write((char*)&p,sizeof(p));
  662. f1.close();
  663. }
  664. }//END OF WHILE
  665. getch();
  666. }
  667.  
  668. //*************************************************
  669. // FUNCTION TO DELETE ALL CUSTOMER RECORDS
  670. //*************************************************
  671.  
  672. void cust_adel()
  673. {
  674. remove("cust.txt");
  675. f1.open("cust.txt",ios::out|ios::binary|ios::in);
  676. p.c_no=0;
  677. p.room_no=0;
  678. }
  679.  
  680. //**********************************************
  681. // FUNCTION TO DELETE A CUSTOMER RECORD
  682. //**********************************************
  683.  
  684. void cust_del()
  685. {
  686. cleardevice();
  687. f1.close();
  688. setfillstyle(7,1);
  689. floodfill(0,0,4);
  690. setfillstyle(7,10);
  691. bar(10,10,600,470);
  692. rectangle(10,10,600,470);
  693. setfillstyle(1,7);
  694. bar(17,17,593,463);
  695. rectangle(17,17,593,463);
  696. setcolor(9);
  697. setfillstyle(1,2);
  698. setcolor(4);
  699. int no,count=1;
  700. outtextxy(30,42,"ENTER CUSTOMER NO TO BE DELETED");
  701. gotoxy(65,4);
  702. cin>>no;
  703. f1.open("cust.txt",ios::in|ios::binary);
  704. fstream f2;
  705. while(f1.read((char*)&p,sizeof(p)))
  706. {
  707. if(p.c_no==no)
  708. {
  709. continue;
  710. }
  711. else
  712. {
  713. f2.open("dup.txt",ios::app|ios::binary);
  714. p.c_no=count;
  715. f2.write((char*)&p,sizeof(p));
  716. count++;
  717. f2.close();
  718. }
  719. }
  720. remove("cust.txt");
  721. rename("dup.txt","cust.txt");
  722. f1.close();
  723. getch();
  724. }
  725. };
  726. //END OF CLASS CUSTOMER
  727. //*****************************************
  728. // THIS CLASS CONTAINS INFORMATION
  729. // ABOUT HOTEL
  730. //*****************************************
  731.  
  732. class hotel
  733. {
  734. private:
  735. fstream f1;
  736.  
  737. struct cust
  738. {
  739. int c_no;
  740. char c_name[20];
  741. char c_add[20];
  742. int a_date;
  743. int a_month;
  744. int a_year;
  745. int d_date;
  746. int d_month;
  747. int d_year;
  748. int room_no;
  749. char room_type[25];
  750. }x;
  751.  
  752. public:
  753. };
  754. //END OF CLASS HOTEL
  755.  
  756. //*******************************************
  757. // CLASS CONTROLLING ALL THE CLASSES
  758. //*******************************************
  759.  
  760. class control
  761. {
  762. private:
  763. int ch;
  764.  
  765. public:
  766. hotel h;
  767. customer cust;
  768. food d;
  769. //***************************
  770. // FUNCTION FOR PASSWORD
  771. //***************************
  772.  
  773. void pass()
  774. {
  775. char passw[20];
  776. for(;;)
  777. {
  778. hot_name();
  779. setcolor(4);
  780. setfillstyle(7,1);
  781. floodfill(0,0,4);
  782. setfillstyle(7,10);
  783. bar(50,60,600,450);
  784. rectangle(50,60,600,450);
  785. setfillstyle(1,7);
  786. bar(57,67,593,443);
  787. rectangle(57,67,593,443);
  788. setcolor(4);
  789. settextstyle(7,0,1);
  790. settextstyle(7,0,2) ;
  791. outtextxy(200,220,"ENTER PASSWORD :-");
  792. gotoxy(55,15);
  793. cin>>passw;
  794. if (strcmp(passw,"a")==0)
  795. {
  796. cleardevice();
  797. break;
  798. }
  799. else
  800. {
  801. setcolor(4);
  802. settextstyle(7,0,1);
  803. for(int i=0;i<10;i++)
  804. {
  805. setcolor(4);
  806. outtextxy(200,320,"ENTER CORRECT PASSWORD ");
  807. delay(100);
  808. setcolor(WHITE);
  809. outtextxy(200,320,"ENTER CORRECT PASSWORD ");
  810. delay(100);
  811. settextstyle(7,0,1);
  812. outtextxy(200,340,"PRESS ANY KEY TO CONTINUE"); }
  813. cleardevice();
  814.  
  815. }
  816. }
  817. do
  818. {
  819. ch=mmenu();
  820. choice(ch);
  821. }while(ch!=5);//END OF WHILE
  822. }
  823.  
  824. //*****************************
  825. // FUNCTION FOR HOTEL NAME
  826. //************************
  827.  
  828. void hot_name()
  829. {
  830. settextstyle(4,0,5);
  831. setcolor(WHITE);
  832. outtextxy(200,3," TIME HOTEL");
  833. line(200,50,440,50);
  834. }
  835.  
  836. //*****************************
  837. // FUNCTION FOR MAIN MENU
  838. //*****************************
  839.  
  840. int mmenu()
  841. {
  842. cleardevice();
  843. int c;
  844. setfillstyle(7,1);
  845. floodfill(0,0,4);
  846. setfillstyle(7,10);
  847. bar(50,80,600,470);
  848. rectangle(50,80,600,470);
  849. setfillstyle(1,7);
  850. bar(57,87,593,463);
  851. rectangle(57,87,593,463);
  852. setcolor(9);
  853. setfillstyle(1,2);
  854. bar(210,140,410,238);
  855. rectangle(210,140,410,158);
  856. rectangle(210,140,410,174);
  857. rectangle(210,140,410,190);
  858. rectangle(210,140,410,206);
  859. rectangle(210,140,410,222);
  860. rectangle(210,140,410,238);
  861. setcolor(WHITE);
  862. settextstyle(4,0,4);
  863. outtextxy(160,20,"HOTEL MANAGEMENT");
  864. setcolor(14);
  865. line(163,60,515,60);
  866. setcolor(4);
  867. settextstyle(1,0,1);
  868. outtextxy(225,137," MAIN MENU");
  869. outtextxy(210,154," 1. INFORMATION");
  870. outtextxy(210,170," 2. CUSTOMER DETAIL");
  871. outtextxy(210,186," 3. FOOD DETAIL ");
  872. outtextxy(210,202," 4. CUSTOMER BILL ");
  873. outtextxy(210,218," 5. EXIT ");
  874. setcolor(4);
  875. settextstyle(7,0,2);
  876. outtextxy(210,300,"ENTER CHOICE :- ");
  877. fflush(stdin);
  878. gotoxy(53,20);
  879. cin>>c;
  880. return c;
  881. }
  882. //************************
  883. // FUNCTION OF ENDING
  884. //************************
  885.  
  886. void bye()
  887. {
  888. cleardevice();
  889. setcolor(12);
  890. settextstyle(1,0,5);
  891. setbkcolor(BLUE);
  892. outtextxy(70,150,"THANKS FOR VISITING");
  893. setcolor(10);
  894. settextstyle(1,0,8);
  895. outtextxy(100,250,"PROJECT");
  896. settextstyle(1,0,3);
  897. outtextxy(150,450,"SHUTTING DOWN.. . .");
  898. getch();
  899. setcolor(12);
  900. settextstyle(1,0,5);
  901. outtextxy(70,150,"THANKS FOR VISITING");
  902. setcolor(10);
  903. settextstyle(1,0,8);
  904. outtextxy(100,250,"PROJECT");
  905. settextstyle(1,0,3);
  906. outtextxy(150,450,"SHUTTING DOWN.. . .");
  907.  
  908. for(int i=0;i<10;i++)
  909. {
  910. sound(1000*i);
  911. setbkcolor(i);
  912. nosound();
  913. }
  914. }
  915.  
  916. //***********************************
  917. // FUNCTION OF CHOICE FOR INFORMATION
  918. //***********************************
  919.  
  920. void choice(int a)
  921. {
  922. switch(a)
  923. {
  924. case 1:
  925. {
  926. information();
  927. break;
  928. }
  929. case 2:
  930. {
  931. cust.cust_detail();
  932. break;
  933. }
  934. case 3:
  935. {
  936. d.food_menu();
  937. break;
  938. }
  939. case 4:
  940. {
  941. cust.cust_bill();
  942. break;
  943. }
  944.  
  945. }
  946. }
  947.  
  948. //***************************
  949. // FUNCTION FOR INFORMATION
  950. //***************************
  951.  
  952. void information()
  953. {
  954. cleardevice();
  955. setfillstyle(7,1);
  956. floodfill(0,0,4);
  957. setfillstyle(7,10);
  958. bar(17,50,605,470);
  959. rectangle(17,50,605,470);
  960. setfillstyle(1,7);
  961. bar(24,57,598,463);
  962. rectangle(24,57,598,463);
  963. gotoxy(6,4);
  964. setcolor(4);
  965. getch();
  966. }
  967. };
  968.  
  969. //**********************************************
  970. // THIS IS MAIN FUNCTION CALLING VARIOUS
  971. // FUNCTIONS
  972. //**********************************************
  973.  
  974. void main()
  975. {
  976. clrscr();
  977. int gm=DETECT,gd;
  978. initgraph(&gm,&gd,"c:\\turboc3\\bgi");
  979. setbkcolor(BLUE);
  980. setcolor(RED);
  981. for(int i=0;i<450;i++)
  982. {circle(305,250,i);
  983. delay(3);
  984. }
  985. setcolor(GREEN);
  986. settextstyle(1,0,11);
  987. outtextxy(80,150,"VINEETA");
  988. getch();
  989. cleardevice();
  990. setbkcolor(BLUE);
  991. setcolor(RED);
  992. for(i=0;i<450;i++)
  993. {circle(305,250,i);
  994. delay(3);
  995. }
  996. setcolor(GREEN);
  997. settextstyle(1,0,9);
  998. outtextxy(100,0,"PRESENTS");
  999. outtextxy(270,120,"A");
  1000. outtextxy(100,240,"PROJECT");
  1001. outtextxy(250,360,"ON");
  1002. getch();
  1003. cleardevice();
  1004. setbkcolor(4);
  1005. setcolor(GREEN);
  1006. for(i=0;i<9;i++)
  1007. {
  1008. settextstyle(1,0,i);
  1009. outtextxy(40+i,140+i," TIME HOTEL ");
  1010. sound(200*i);
  1011. delay(600);
  1012. nosound();
  1013. cleardevice();
  1014. }
  1015. outtextxy(46,146," TIME HOTEL");
  1016. getch();
  1017. control c;
  1018. // void acknow()
  1019. //{
  1020. // cleardevice();
  1021. setbkcolor(BLACK);
  1022. setfillstyle(7,1);
  1023. floodfill(0,0,4);
  1024. setfillstyle(7,10);
  1025. bar(17,50,605,470);
  1026. rectangle(17,50,605,470);
  1027. setfillstyle(1,7);
  1028. bar(24,57,598,463);
  1029. rectangle(24,57,598,463);
  1030. setcolor(5);
  1031. settextstyle(1,0,5);
  1032. outtextxy(85,5,"ACKNOWLEDGEMENT");
  1033. settextstyle(1,0,3);
  1034. setcolor(BLACK);
  1035. outtextxy(80,60,"I wish to express my deep and heartiest");
  1036. outtextxy(40,90,"thanks to my sir :Mr. RAMESH YADAV whose");
  1037. outtextxy(40,120,"valueable advice,guidence and helped me a ");
  1038. outtextxy(40,150,"lot in doing this project from conception to");
  1039. outtextxy(40,180,"completion ");
  1040. outtextxy(100,210,"I am also very thankful to my parents ");
  1041. outtextxy(40,240,"and friends who gave me moral encouragement ");
  1042. outtextxy(40,270,"to make this project a success.");
  1043. outtextxy(40,300,"SUBMITTED BY:- ");
  1044. outtextxy(40,330,"VINEETA ");
  1045. outtextxy(40,360,"B.TECH.III Year ");
  1046. outtextxy(40,390,"Shri Krishan Institute of ");
  1047. outtextxy(40,420,"Engg. & Technology ");
  1048. getch();
  1049. cleardevice();
  1050.  
  1051. // FOR VERIFICATION
  1052. setfillstyle(7,1);
  1053. floodfill(0,0,4);
  1054. setfillstyle(7,10);
  1055. bar(17,50,605,470);
  1056. rectangle(17,50,605,470);
  1057. setfillstyle(1,7);
  1058. bar(24,57,598,463);
  1059. rectangle(24,57,598,463);
  1060. setcolor(5);
  1061. settextstyle(1,0,5);
  1062. outtextxy(120,5,"VERIFICATION");
  1063. settextstyle(1,0,3);
  1064. setcolor(BLACK);
  1065. outtextxy(40,60,"I VINEETA submitting this project");
  1066. outtextxy(40,90,"as an evidence of my work in computer");
  1067. outtextxy(40,120,"lab. in guidence of Mr.RAMESH YADAV ");
  1068. outtextxy(40,190,"SUBMITTED BY:- SUBMITTED TO:-");
  1069. outtextxy(40,220,"VINEETA Mr.RAMESH YADAV");
  1070. outtextxy(40,250,"B.TECH.III Year lecturer in computer");
  1071. outtextxy(40,280, "Shri Krishan Institute Of Hartron Workstation ");
  1072. outtextxy(40,310,"Engg. & Technology ");
  1073. getch();
  1074. cleardevice();
  1075.  
  1076.  
  1077. c.pass();
  1078. c.bye();
  1079. closegraph();
  1080. }
  1081.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:15:9: fatal error: 'graphics.h' file not found
#include<graphics.h>
        ^
1 error generated.
stdout
Standard output is empty