Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- string firstlastname;
- int seats = 13;
- char selection;
- cout << "Please enter your first and last name.\n";
- getline(cin, firstlastname);
- do
- {
- cout << " Welcome " << firstlastname << " to FlightSpace Airlines!\n";
- cout << " ====================================\n";
- cout << " 1. Make a reservation\n";
- cout << " 2. Check a reservation\n";
- cout << " 3. Cancel a Reservation\n";
- cout << " 4. Check flight status\n";
- cout << " 5. Check Local Weather\n";
- cout << "\n";
- cout << " 6. Exit\n";
- cout << " ====================================\n";
- cout << " Enter your selection: ";
- cin >> selection;
- cout << endl;
- switch (selection)
- {
- case '1':
- {
- cout << "Make a selection below!";
- cout << "\n";
- cout << "There are currently " << seats << " seats available!\n";
- cout << "Would you like to make a reservation?\n";
- char selection;
- do
- {
- cout << " 1: Yes\n";
- cout << " 2: No\n";
- switch (selection)
- {
- case '1':
- cout << "Great! lets get started!\n";
- cout << "\n";
- cout << "You are currenly in Dallas, Texas.\n";
- cout << "Where would you like to go to?\n";
- case '2':
- cout << "Goodbye!\n";
- return 0;
- default: cout << selection << "is not a valid menu item.\n";
- }
- }
- }
- break;
- case '2':
- cout << "Check a reservation\n";
- cout << "\n";
- break;
- case '3':
- cout << "Cancel a Reservation";
- cout << "\n";
- break;
- case '4':
- cout << "Flight Status is:\n";
- cout << "\n";
- break;
- case '5':
- cout << "The Local Weather is 79f\n";
- break;
- case '6':
- cout << "Goodbye!\n";
- return 0;
- default: cout << selection << "is not a valid menu item.\n";
- cout << endl;
- }
- } while (selection != 0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement