Advertisement
Kennyyyy

Flight Reservation

Apr 26th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.50 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     string firstlastname;
  10.     int seats = 13;
  11.  
  12.     char selection;
  13.     cout << "Please enter your first and last name.\n";
  14.     getline(cin, firstlastname);
  15.  
  16.     do
  17.     {
  18.         cout << "  Welcome " << firstlastname << " to FlightSpace Airlines!\n";
  19.         cout << "  ====================================\n";
  20.         cout << "  1.  Make a reservation\n";
  21.         cout << "  2.  Check a reservation\n";
  22.         cout << "  3.  Cancel a Reservation\n";
  23.         cout << "  4.  Check flight status\n";
  24.         cout << "  5.  Check Local Weather\n";
  25.         cout << "\n";
  26.         cout << "  6.  Exit\n";
  27.         cout << "  ====================================\n";
  28.         cout << "  Enter your selection: ";
  29.         cin >> selection;
  30.         cout << endl;
  31.  
  32.         switch (selection)
  33.         {
  34.         case '1':
  35.         {
  36.             cout << "Make a selection below!";
  37.             cout << "\n";
  38.             cout << "There are currently " << seats << " seats available!\n";
  39.             cout << "Would you like to make a reservation?\n";
  40.          
  41.             char selection;
  42.  
  43.             do
  44.             {
  45.                 cout << " 1: Yes\n";
  46.                 cout << " 2: No\n";
  47.  
  48.                 switch (selection)
  49.                 {
  50.                 case '1':
  51.                     cout << "Great! lets get started!\n";
  52.                     cout << "\n";
  53.                     cout << "You are currenly in Dallas, Texas.\n";
  54.                     cout << "Where would you like to go to?\n";
  55.  
  56.  
  57.                 case '2':
  58.                     cout << "Goodbye!\n";
  59.                     return 0;
  60.                 default: cout << selection << "is not a valid menu item.\n";
  61.  
  62.                 }
  63.             }
  64.  
  65.  
  66.  
  67.         }
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.         break;
  76.         case '2':
  77.             cout << "Check a reservation\n";
  78.             cout << "\n";
  79.             break;
  80.         case '3':
  81.             cout << "Cancel a Reservation";
  82.             cout << "\n";
  83.             break;
  84.  
  85.         case '4':
  86.             cout << "Flight Status is:\n";
  87.             cout << "\n";
  88.             break;
  89.  
  90.         case '5':
  91.             cout << "The Local Weather is 79f\n";
  92.             break;
  93.  
  94.         case '6':
  95.             cout << "Goodbye!\n";
  96.             return 0;
  97.         default: cout << selection << "is not a valid menu item.\n";
  98.  
  99.             cout << endl;
  100.         }
  101.  
  102.     } while (selection != 0);
  103.  
  104.     return 0;
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement