Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.52 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. #include <iomanip>
  4. using namespace std;
  5.  
  6. void guestreser();
  7. void reservation();
  8.  
  9.  
  10. struct Guest {
  11. string name;
  12. string surname;
  13. int ID;
  14. string country;
  15. string date;
  16. void guestreser();
  17.  
  18. };
  19. void guestreser()
  20. {
  21. Guest guest1;
  22. char choice;
  23.  
  24. cout << "Enter your Name:";
  25. cin >> guest1.name << endl;
  26. cout << "Enter your Surname";
  27. cin >> guest1.surname << endl;
  28. cout << "Enter your ID no: ";
  29. cin >> guest1.ID << endl;
  30. cout << "Which country are u coming from:";
  31. cin >> guest1.country << endl;
  32. }
  33.  
  34. struct hotel_info {
  35. string stars;
  36. string free_offers;
  37. int price;
  38.  
  39. };
  40.  
  41. struct hotel {
  42. string name;
  43. string country;
  44. hotel_info facilities;
  45. string roomoffers;
  46.  
  47. void printhotel()
  48. {
  49. hotel h;
  50. cout << "Informations related to hotel:" << endl;
  51. cout << "|--------------------------------------------------------------------------------------------------------------------|" << endl;
  52. cout << setw(8) << "Hotel's name";
  53. cout << setw(13) << "Hotel's location";
  54. cout << setw(16) << "Hotel's facilities";
  55. cout << setw(20) << "Hotel's room" << endl;
  56. cout << "|---------------------------------------------------------------------------------------------------------------------|" << endl;
  57.  
  58.  
  59. for (int i = 0; i < 10; i++)
  60. {
  61. cout << setw(3) << "|" << setw(6) << h.name;
  62. cout << setw(13) << h.country;
  63. cout << setw(16) << h.facilities.stars;
  64. cout << setw(16) << h.facilities.free_offers;
  65. cout << setw(20) << h.facilites.roomoffers << "|" << endl;
  66. }
  67.  
  68. }
  69. cout << "|----------------------------------------------------------------------------------------------------------------------|" << endl;
  70. };
  71.  
  72.  
  73. int main()
  74. {
  75.  
  76.  
  77. hotel resort;
  78.  
  79. int x;
  80.  
  81.  
  82. resort.name = {" Alhambra Hotel" };
  83. resort.country = { "Egypt" };
  84. resort.facilities.stars = { 5 };
  85. resort.facilities.free_offers = { "Free parking","Free Wi-fi","Free breakfast","Airport transfer" };
  86. resort.facilities.roomoffers = { "Single Room","Double Room","Queen Room" };
  87.  
  88. cout << endl;
  89. cout << " / \ " << endl;
  90. cout << " // \\ " << endl;
  91. cout << " /// Welcome to the Alhambra Hotel's Reservation Programe\\\ " << endl;
  92. cout << " \\ //" << endl;
  93. cout << " \ / " << endl;
  94. cout << endl;
  95.  
  96. for (int i = 0; i < 10; i++)
  97. {
  98. cout << "Press 1 for more information about the hotel" << endl;
  99. cout << endl;
  100. cout << "Press 2 for booking a room!" << endl;
  101. cout << endl;
  102. cout << "Press 3 to exit the programe" << endl;
  103. cout << endl;
  104.  
  105. cout << "Enter Here:"cin >> x;
  106.  
  107. switch (x)
  108. {
  109. case 1:
  110. resort.printhotel();
  111. break;
  112. case 2:
  113. reservation();
  114. break;
  115. case 3:
  116. break;
  117.  
  118. }
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126. }
  127.  
  128.  
  129. Guest g1;
  130. g1.guestreser();
  131. Hotel h1;
  132. h1.
  133.  
  134. cin.get(); cin.get();
  135. return 0;
  136. }
  137.  
  138. void reservation()
  139. {
  140. int days, choice, price1,price2,price3;
  141. char repeat;
  142. int a = 1000;
  143. int single = 250;
  144. int double = 500;
  145. int queen = 1000;
  146.  
  147. do {
  148. cout << "What type of room do you choose?" << endl;
  149. cout << endl;
  150. cout << "1.Single Room" << endl;
  151. cout << endl;
  152. cout << "2.Double Room" << endl;
  153. cout << endl;
  154. cout << "3.Queen Room" << endl;
  155. cout << endl;
  156.  
  157. cout << "Enter your choice__:"endl;
  158. cout << endl;
  159. cin >> choice;
  160. switch (choice)
  161. {
  162.  
  163. case 1:
  164. cout << "Single Room." << endl;
  165. cout << endl;
  166. cout << "How many days are you staying:" << endl;
  167. cin >> days << endl;
  168.  
  169. price1 = a * single * days;
  170. cout << "The total price is " << price1 << endl;
  171. break;
  172.  
  173. case 2:
  174. cout << "Double Room" << endl;
  175. cout << endl;
  176. cout << "How many days are you staying:" << endl;
  177. cin >> days << endl;
  178.  
  179. price2 = a * double* days;
  180. cout << "The total is going to be:" << price2 << endl;
  181. break;
  182. case 3:
  183. cout << "Queen Room" << endl;
  184. cout << endl;
  185. cout << "How many days are you staying:" << endl;
  186. cin >> days << endl;
  187.  
  188. price3 = a * queen* days;
  189. cout << "The total is going to be:" << price3 << endl;
  190. break;
  191. default:
  192. cout << "Wrong Choice" << endl;
  193. cout << endl;
  194.  
  195. }
  196.  
  197. cout << "For checking another room press 'J' :";
  198. cin >> repeat;
  199. cout << endl;
  200.  
  201. } while (repeat == 'J' || repeat == 'j');
  202.  
  203.  
  204. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement