Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <windows.h>
- using namespace std;
- int main()
- {
- char bclass, mpref, spref, memb, spreq, dof;
- string conf, email, name, sbclass, date, sdate, smpref, sspref, smemb, sspreq, sdof;
- int clOffer = 0, dateOffer = 0, mealOffer = 0, seatOffer = 0, membOffer = 0, specOffer = 0, duraOffer = 0;
- int clCon = 0, specCon = 0, duraCon = 0;
- cout << "Welcome to SkySail Airlines!" << endl << endl << endl;
- while (true) {
- cout << "Do you want to book a ticket? (Yes/No): ";
- cin >> conf;
- if (conf == "No" || conf == "N" || conf == "n" || conf == "no") {
- system("cls");
- cout << "We would love to fly with you soon!\n\n" << endl;
- break;
- }
- else if (conf == "Yes" || conf == "Y" || conf == "y" || conf == "yes" || conf == "ye") {
- system("cls");
- cout << "Loading options...\n\n";
- Sleep(3000);
- system("cls");
- cin.ignore();
- cout << "SkySail Airlines Reservation System" << endl << endl;
- cout << "Booking Class" << endl << endl;
- cout << "1. [F]irst Class\n2. [B]usiness\n3. [P]remium Economy\n4. [E]conomy" << endl << endl;
- cin >> bclass;
- system("cls");
- switch (bclass) {
- case '1':
- case 'F':
- case 'f':
- sbclass = "First Class";
- clOffer = 1;
- break;
- case '2':
- case 'B':
- case 'b':
- sbclass = "Business";
- clOffer = 2;
- break;
- case '3':
- case 'P':
- case 'p':
- sbclass = "Premium Economy";
- clOffer = 3;
- break;
- case '4':
- case 'E':
- case 'e':
- sbclass = "Economy";
- clOffer = 4;
- break;
- default:
- cout << "Invalid selection. Please choose a valid option." << endl;
- continue;
- }
- system("cls");
- cout << "SkySail Airlines Reservation System" << endl << endl;
- cout << "Enter the date of flight (MM/DD/YYYY): ";
- cin >> date;
- string monthStr = date.substr(0, 2);
- int month = stoi(monthStr);
- if ((month >= 1 && month <= 4) || (month >= 10 && month <= 12)) {
- sdate = "Peak";
- dateOffer = 1;
- }
- else if (month >= 6 && month <= 9) {
- sdate = "Off-peak";
- dateOffer = 0;
- }
- else {
- cout << "Invalid month. Please enter a valid date in the format MM/DD/YYYY." << endl;
- continue;
- }
- system("cls");
- cout << "SkySail Airlines Reservation System" << endl << endl;
- cout << "What type of meal set would you prefer?" << endl;
- cout << "1. [N]on-vegetarian\n2. [Ve]getarian\n3. [V]egan\n4. [G]luten-free\n\n";
- cin >> mpref;
- switch (mpref) {
- case '1':
- case 'N':
- case 'n':
- smpref = "Non-vegetarian";
- mealOffer = 1;
- break;
- case '2':
- case 'VE':
- case 've':
- case 'Ve':
- smpref = "Vegetarian";
- mealOffer = 2;
- break;
- case '3':
- case 'V':
- case 'v':
- smpref = "Vegan";
- mealOffer = 3;
- break;
- case '4':
- case 'G':
- case 'g':
- smpref = "Gluten-free";
- mealOffer = 4;
- break;
- default:
- cout << "Invalid selection. Please choose a valid option." << endl;
- continue;
- }
- system("cls");
- cout << "SkySail Airlines Reservation System" << endl << endl;
- cout << "What seat position would you like? " << endl;
- cout << "1. [A]isle\n2. [W]indow\n3. [M]iddle" << endl << endl;
- cin >> spref;
- switch (spref) {
- case '1':
- case 'A':
- case 'a':
- sspref = "Aisle";
- seatOffer = 1;
- break;
- case '2':
- case 'W':
- case 'w':
- sspref = "Window";
- seatOffer = 2;
- break;
- case '3':
- case 'M':
- case 'm':
- sspref = "Middle";
- seatOffer = 3;
- break;
- default:
- cout << "Invalid selection. Please choose a valid option." << endl;
- continue;
- }
- system("cls");
- cout << "SkySail Airlines Reservation System" << endl << endl;
- cout << "Special Requirements" << endl;
- cout << "1. [W]heelchair Access\n2. Near [R]estroom\n3. Extra [L]egroom\n4. [N]o Special Requirements\n" << endl;
- cin >> spreq;
- switch (spreq) {
- case '1':
- case 'W':
- case 'w':
- sspreq = "Wheelchair Access";
- specOffer = 1;
- break;
- case '2':
- case 'R':
- case 'r':
- sspreq = "Near Restroom";
- specOffer = 2;
- break;
- case '3':
- case 'L':
- case 'l':
- sspreq = "Extra Legroom";
- specOffer = 3;
- break;
- case '4':
- case 'N':
- case 'n':
- sspreq = "No Special Requirements";
- specOffer = 4;
- break;
- default:
- cout << "Invalid selection. Please choose a valid option." << endl;
- continue;
- }
- system("cls");
- cout << "SkySail Airlines Reservation System" << endl << endl;
- cout << "How long would you want to travel?" << endl;
- cout << "1. [S]hort-haul\n2. [M]edium-haul\n3. [L]ong-haul\n\n";
- cin >> dof;
- switch (dof) {
- case '1':
- case 'S':
- case 's':
- sdof = "Short-haul";
- duraOffer = 1;
- break;
- case '2':
- case 'M':
- case 'm':
- sdof = "Medium-haul";
- duraOffer = 2;
- break;
- case '3':
- case 'L':
- case 'l':
- sdof = "Long-haul";
- duraOffer = 3;
- break;
- default:
- cout << "Invalid selection. Please choose a valid option." << endl;
- continue;
- }
- system("cls");
- cout << "SkySail Airlines Reservation System" << endl << endl;
- cout << "Loyalty Membership" << endl;
- cout << "1. [G]old\n2. [S]ilver\n3. [B]ronze\n4. [N]one\n" << endl;
- cin >> memb;
- switch (memb)
- {
- case '1':
- case 'G':
- case 'g':
- smemb = "Gold";
- membOffer = 1;
- break;
- case '2':
- case 'S':
- case 's':
- smemb = "Silver";
- membOffer = 2;
- break;
- case '3':
- case 'B':
- case 'b':
- smemb = "Bronze";
- membOffer = 3;
- break;
- case '4':
- case 'N':
- case 'n':
- smemb = "Unavailable";
- membOffer = 4;
- break;
- default:
- cout << "Invalid selection. Please choose a valid option." << endl;
- break;
- }
- system("cls");
- cout << "Fetching your selected details...\n\n\n\n";
- Sleep(4000);
- system("cls");
- cout << "SkySail Airlines Reservation System" << endl << endl;
- cout << "Selected seat class: " << sbclass << "\t\t" << "Flying on " << date << endl << endl;
- cout << "Preferred meal set: " << smpref << "\t\t" << "Seat preference: " << sspref << endl;
- cout << "Duration of flight: " << sdof << "\t\t\n" << "Special Requirements: " << sspreq << endl << endl;
- cout << smemb << " Membership" << endl << endl << endl;
- cout << "Due to your selected flight conditions, you have been granted with the following offers!" << endl << endl;
- if (clOffer == 1) {
- if (membOffer == 1) clCon = 2;
- else clCon = 1;
- }
- else if (clOffer == 2 && (membOffer == 1 || membOffer == 2)) {
- clCon = 3;
- }
- else if (clOffer == 3 && dateOffer == 1) {
- clCon = 4;
- }
- else if (clOffer == 4) {
- if (seatOffer == 3 && membOffer == 3) clCon = 5;
- else if (seatOffer == 3) clCon = 6;
- else if (membOffer == 3) clCon = 7;
- }
- switch (clCon) {
- case 1:
- cout << "Free WiFi" << endl;
- break;
- case 2:
- cout << "Free WiFi" << endl;
- cout << "Airport Lounge Access" << endl;
- break;
- case 3:
- cout << "Priority Boarding" << endl;
- break;
- case 4:
- cout << "Your next flight booking is discounted" << endl;
- break;
- case 5:
- cout << "Free Neck Pillow" << endl;
- cout << "5% discount for in-flight meals" << endl;
- break;
- case 6:
- cout << "Free Neck Pillow" << endl;
- break;
- case 7:
- cout << "5% discount for in-flight meals" << endl;
- break;
- }
- if (duraOffer == 3) {
- if (seatOffer == 1) duraCon = 2;
- else if (seatOffer == 2) duraCon = 3;
- else duraCon = 1;
- }
- else if (duraOffer == 2 && seatOffer == 1) {
- duraCon = 4;
- }
- else if (duraOffer == 1 && (mealOffer == 2 || mealOffer == 3)) {
- clCon = 4;
- }
- switch (duraCon) {
- case 1:
- cout << "Provided with a blanket and headphones" << endl;
- break;
- case 2:
- cout << "Provided with a blanket and headphones" << endl;
- cout << "Free drink voucher" << endl;
- break;
- case 3:
- cout << "Provided with a blanket and headphones" << endl;
- cout << "Sleeping kit" << endl;
- break;
- case 4:
- cout << "Entertainment system with a charging port" << endl;
- break;
- }
- if (specOffer != 4) {
- cout << "\n\nDue to having " << sspreq << " requirement. We will provide you with ";
- if (specOffer == 1) {
- cout << "ground staff assistance during boarding and de-boarding and seats close to the entrance" << endl;
- }
- else if (specOffer == 2) {
- cout << "seats near the restroom" << endl;
- }
- else if (specOffer == 3) {
- cout << "availability for front-row seats" << endl;
- }
- }
- else
- cout << " ";
- cout << "\n\nConfirm your details and ticket. Enter your email address: ";
- cin.ignore();
- getline(cin, email);
- cout << "\nEnter your name: ";
- getline(cin, name);
- system("cls");
- cout << "Please wait..." << endl;
- Sleep(1000);
- system("cls");
- cout << "SkySail Airlines Reservation System" << endl;
- cout << "\n\nSending the ticket to " << email << "..." << endl;
- Sleep(2000);
- cout << "\nTicket sent to " << email << ". Thank you " << name << " for flying with SkySail Airlines!" << endl;
- cout << "\nWe're looking forward to flying with you again!" << endl;
- break;
- }
- }
- return 0;
- }
- /*
- Conditions:
- bclass(first class) = auto free wifi
- bclass(first class) && memb (gold) = airport lounge access
- bclass(economy) && spref(middle) = neck pillow
- bclass(business) && memb(silver||gold) = prio boarding
- bclass(premium economy) && dot(peak) = avail discount for next booking
- bclass(economy) && memb(bronze) = 5% discount on flight meal
- dof(short-haul) && mpref(vegetarian||vegan) = offer snack box
- dof(medium-haul && spref(window) = es with charging port
- dof(long-haul) = blanket and headphones
- dof(long-haul) && spref(aisle) = free drink voucher
- dof(long-haul) && spref(window)= sleeping kit
- mpref(vegan||gluten-free) = confirm meal 48 hours before flight
- sreq(extra legroom) = always front-row seat
- sreq(wheelchair) = assistance, seat close to entrance
- sreq(near restroom) = not next to emergency exits
- /*Conditions
- Booking Class: Economy, Premium Economy, Business, First Class.
- ● Date of Travel: Determines peak or off-peak travel times.
- ● Meal Preference: Vegetarian, Non-Vegetarian, Vegan, Gluten-Free, etc.
- ● Seat Preference: Aisle, Window, or Middle.
- ● Loyalty Membership: Gold, Silver, Bronze, or None.
- ● Special Requirements: Wheelchair access, near restroom, extra legroom.
- ● Duration of Flight: Short-haul (< 3 hours), Medium-haul (3-6 hours), Long-haul (>
- 6 hours).
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement