Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.25 KB | None | 0 0
  1.  
  2.  
  3.  
  4. #include <iostream>
  5. #include <iomanip>
  6. using namespace std;
  7. string cityOrig1, cityDest1, cityOrig2, cityDest2;
  8. int flight_number1, timedpt1, timearv1, datearv1, datedpt1, tickprice1, datetoday1;
  9. int flight_number2, timedpt2, timearv2, datearv2, datedpt2, tickprice2, datetoday2;
  10. char ok = 'F';
  11. void the_flights(string cityname);
  12. void admin_add_flight1();
  13. void admin_add_flight2();
  14. //void displayflights;
  15.  
  16.  
  17.  
  18.  
  19. int main()
  20.  
  21.  
  22. {
  23. admin_add_flight1();
  24. }
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. void admin_add_flight1()//cityDest,timedpt,datedpt,timearv,datearv
  34. {
  35.  
  36.  
  37.  
  38. do
  39. {
  40. cout<<"Enter Date Today(MMDDYYYY)(Example: 10242019): ";
  41. cin>>datetoday1;
  42. }while(datetoday1<=10232019);
  43.  
  44.  
  45. do{
  46. cout<<"Enter Flight Origin: ";
  47. the_flights(cityOrig1);
  48. system ("cls");
  49. cout<<"Enter Flight Destination: "<<endl;
  50. the_flights(cityDest1);
  51. cout<<"Your City Origin "<<cityOrig1<<endl;
  52. cout<<"Your City Destination "<<cityDest1<<endl;
  53. cout<<"Are Your Choices Correct[T/F]? ";
  54. cin>>ok;
  55.  
  56. }while(ok!='T'||ok!='t');
  57.  
  58.  
  59. do// DEPARTURE TIME
  60. {
  61. cout<<"Enter Flight Departure Time (MILITARY TIME FORMAT): ";
  62. cin>>timedpt1;
  63. cout<<endl;
  64. system ("cls");
  65. } while(timedpt1<=0||timedpt1>2400);
  66. do// DEPARTURE DATE
  67. {
  68. cout<<"Enter Flight Departure date (MMDDYYYY): ";
  69. cin>>datedpt1;
  70. cout<<endl;
  71. system ("cls");
  72. }while(datedpt1>12312020||datedpt1<datetoday1);
  73. do //TIME ARRIVAL
  74. {
  75. cout<<"Enter Flight Arrival Time (MILITARY TIME FORMAT): ";
  76. cin>>timearv1;
  77. cout<<endl;
  78. system ("cls");
  79. } while(timearv1<=0||timearv1>2400);
  80. do//ARRIVAL DATE
  81. {
  82. cout<<"Enter Flight Arrival Date (MMDDYYYY): ";
  83. cin>>datearv1;
  84. cout<<endl;
  85. system ("cls");
  86. } while(datearv1>12312020||datearv1<datetoday1);
  87. do//FLIGHT COST
  88. {
  89. cout<<"Enter Flight Cost: ";
  90. cin>>tickprice1;
  91. cout<<endl;
  92. system ("cls");
  93. }while(tickprice1<0);
  94.  
  95. }//FUNCTION END ADMIN ADD FLIGHT 1
  96.  
  97.  
  98.  
  99. void admin_add_flight2()//cityDest,timedpt,datedpt,timearv,datearv
  100. {
  101.  
  102.  
  103. do
  104. {
  105. cout<<"Enter Date Today(MMDDYYYY)(Example: 10242019): "<<endl;
  106. cin>>datetoday2;
  107. }while(datetoday2<=10232019);
  108.  
  109. do{
  110. cout<<"Enter Flight Origin: ";
  111. the_flights(cityOrig2);
  112. system ("cls");
  113. cout<<"Enter Flight Destination: "<<endl;
  114. the_flights(cityDest2);
  115. cout<<"Your City Origin "<<cityOrig2<<endl;
  116. cout<<"Your City Destination "<<cityDest2<<endl;
  117. cout<<"Are Your Choices Correct[T/F]? ";
  118. cin>>ok;
  119. }while(ok!='T'||ok!='t');
  120.  
  121. do// DEPARTURE TIME
  122. {
  123. system ("cls");
  124. cout<<"Enter Flight Departure Time (MILITARY TIME FORMAT): ";
  125. cin>>timedpt2;
  126. cout<<endl;
  127. system ("cls");
  128. } while(timedpt2<=0||timedpt2>2400);
  129. do// DEPARTURE DATE
  130. {
  131. cout<<"Enter Flight Departure date (MMDDYYYY): ";
  132. cin>>datedpt2;
  133. cout<<endl;
  134. system ("cls");
  135. }while(datedpt2>12312020||datedpt2<datetoday2);
  136. do //TIME ARRIVAL
  137. {
  138. cout<<"Enter Flight Arrival Time (MILITARY TIME FORMAT): ";
  139. cin>>timearv2;
  140. cout<<endl;
  141. system ("cls");
  142. } while(timearv2<=0||timearv2>2400);
  143. do//ARRIVAL DATE
  144. {
  145. cout<<"Enter Flight Arrival Date (MMDDYYYY): ";
  146. cin>>datearv2;
  147. cout<<endl;
  148. system ("cls");
  149. } while(datearv2>12312020||datearv2<datetoday2);
  150. do//FLIGHT COST
  151. {
  152. cout<<"Enter Flight Cost: ";
  153. cin>>tickprice2;
  154. cout<<endl;
  155. system ("cls");
  156. }while(tickprice2<0);
  157.  
  158. }//FUNCTION END ADMIN ADD FLIGHT 1
  159.  
  160. void the_flights(string cityname)
  161. { int city;
  162. do
  163. {
  164. cout<<"====================DOMESTIC CITIES======================"<<endl
  165. <<"ENTER CITY [1-20]"<<endl
  166. <<"[1] BCD-Bacolod [11] CRK-Clark "<<endl
  167. <<"[2] BSO-Batanes-(Basco) [12] USU-Coron-(Busuanga)"<<endl
  168. <<"[3] TAG-Bohol [13] CBO-Cotabato "<<endl
  169. <<"[4] MPH-Boracay-(Caticlan) [14] DVO-Davao "<<endl
  170. <<"[5] BXU-Butuan [15] DPL-Dipolog "<<endl
  171. <<"[6] CGY-Cagayan-de-Oro [16] DGT-Dumaguete "<<endl
  172. <<"[7] CYP-Calbayog [17] GES-General-Santos "<<endl
  173. <<"[8] CGM-Camiguin [18] ILO-Iloilo "<<endl
  174. <<"[9] CYZ-Cauayan [19] KLO-Kalibo "<<endl
  175. <<"[10] CEB-Cebu [20] MNL-Manila "<<endl
  176. <<"========================================================="<<endl;
  177. cout<<"ENTER CITY [1-20]: ";
  178. cin>>city;
  179. system("cls");
  180. }while(city<1||city>20);
  181.  
  182.  
  183. switch(city)
  184. {
  185. case 1:
  186. {
  187. cityname = "Bacolod";
  188. break;
  189. }
  190.  
  191. case 2:
  192. {
  193. cityname = "Batanes-(Basco)";
  194. break;
  195. }
  196.  
  197. case 3:
  198. {
  199. cityname = "Bohol";
  200. break;
  201. }
  202. case 4:
  203. {
  204. cityname = "Boracay-(Caticlan)";
  205. break;
  206. }
  207. case 5:
  208. {
  209. cityname = "Butuan";
  210. break;
  211. }
  212. case 6:
  213. {
  214. cityname = "Cagayan-de-Oro";
  215. break;
  216. }
  217. case 7:
  218. {
  219. cityname = "Calbayog";
  220. break;
  221. }
  222. case 8:
  223. {
  224. cityname = "Camiguin";
  225. break;
  226. }
  227. case 9:
  228. {
  229. cityname = "Cauayan";
  230. break;
  231. }
  232. case 10:
  233. {
  234. cityname = "Cebu";
  235. break;
  236. }
  237. case 11:
  238. {
  239. cityname = "Clark";
  240. break;
  241. }
  242. case 12:
  243. {
  244. cityname = "Coron-(Busuanga)";
  245. break;
  246. }
  247. case 13:
  248. {
  249. cityname = "Cotabato";
  250. break;
  251. }
  252. case 14:
  253. {
  254. cityname = "Davao";
  255. break;
  256. }
  257. case 15:
  258. {
  259. cityname = "Dipolog";
  260. break;
  261. }
  262. case 16:
  263. {
  264. cityname = "Dumaguete";
  265. break;
  266. }
  267. case 17:
  268. {
  269. cityname = "General-Santos";
  270. break;
  271. }
  272. case 18:
  273. {
  274. cityname = "Iloilo";
  275. break;
  276. }
  277. case 19:
  278. {
  279. cityname = "Kalibo";
  280. break;
  281. }
  282. case 20:
  283. {
  284. cityname = "Manila";
  285. break;
  286. }
  287.  
  288. }
  289.  
  290. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement