Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <string>
- #include <cctype>
- #include <windows.h>
- // ALL DEFAULT ARGUMENT ARE BUGGED, IT EITHER LOOPS INFINITELY OR LOOPS RIGHT BACK FROM THE START NEED TO FIX
- using namespace std;
- int main()
- {
- char bclass, mpref, spref, memb, spreq, dof;
- string conf, email, sbclass, date, sdate, smpref, sspref, smemb, sspreq, sdof;
- // added s to chars means selected e.g sdate = selected date, for the ticket/s
- int clOffer, dateOffer, mealOffer, seatOffer, membOffer, specOffer, duraOffer, clCon;
- // values for offers (the ones with && offers)
- 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");
- 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;
- //error when input is not in the case selection
- }
- system("cls");
- cout << "SkySail Airlines Reservation System" << endl << endl;
- cout << "Enter the date of flight (MM/DD/YYYY): ";
- getline(cin, date);
- cin >> date;
- string monthStr = date.substr(0, 2);
- int month;
- month = stoi(monthStr);
- if (month >= 1 && month <= 4)
- {
- sdate = "Peak";
- dateOffer = 1;
- //cout << "Peak season: January to April" << endl;
- }
- else if (month >= 10 && month <= 12)
- {
- sdate = "Peak";
- dateOffer = 1;
- //cout << "Peak season: October to December" << endl;
- }
- else if (month >= 6 && month <= 9)
- {
- sdate = "Off-peak";
- dateOffer = 0;
- //cout << "Off-peak season: May to September" << endl;
- }
- else
- {
- cout << "Invalid month. Please enter a valid date in the format MM/DD/YYYY." << endl;
- //code breaks user-input is character, need to fix
- }
- 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;
- }
- 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;
- }
- 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;
- break;
- }
- 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;
- break;
- }
- 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 preferrence: " << sspref << endl;
- cout << "Duration of flight: " << sdof << "\t\t" << "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 << endl;
- if (specOffer != 4)
- {
- cout << "\n\nDue to having " << sspreq << " requirement. We will provide you with ";
- if (specOffer == 1)
- {
- cout << "ground staff assisstance during boarding and de-boarding and seats close to the entrance" << endl;
- }
- else if (specOffer == 2)
- {
- cout << "seats near to the restroom" << endl;
- }
- else if (specOffer == 3)
- {
- cout << "avail for front-row seats" << endl;
- }
- }
- else
- // confirm food and then request email to send ticket
- break;
- return 0;
- }
- }
- /*
- switch (clCon)
- {
- case (clOffer == 1 && membOffer == 1):
- }
- //Class conditions
- if (clOffer == 1 && membOffer == 1)
- {
- }
- else if (clOffer == 1)
- {
- }
- else if (clOffer == 2 && membOffer == 1 || membOffer == 2)
- {
- }
- else if (clOffer == 3 && dateOffer == 1)
- {
- }
- else if (clOffer == 4 && seatOffer == 3)
- {
- }
- else if (clOffer == 4 && membOffer == 3)
- {
- }
- else
- //Duration offer
- if (duraOffer == 1 && seatOffer == 1)
- {
- cout << "Blanket and headphones" << endl;
- cout << "Free drink voucher" << endl;
- }
- else if (duraOffer == 1 && seatOffer == 2)
- {
- cout << "Blanket and headphones" << endl;
- cout << "Provided sleeping kit" << endl;
- }
- else if (duraOffer == 1)
- {
- cout << "Blanket and headphones" << endl;
- }
- else if (duraOffer == 2 && seatOffer == 2)
- {
- cout << "Entertainment system with charging port" << endl;
- }
- else if (duraOffer == 3 && mealOffer == 2 || mealOffer == 3)
- {
- cout << "Complimentary snack box" << endl;
- }
- else
- cout << endl << endl << endl;
- */
- // clOffer, dateOffer, mealOffer, seatOffer, membOffer, specOffer, duraOffer;
- /*
- bclass, mpref, spref, memb, spreq, dof;
- conf, email, sbclass, date, sdate, smpref, sspref, smemb, sspreq, sdof;
- // added s to chars means selected e.g sdate = selected date, for the ticket/s
- // VALUES FOR MESSAGES
- clOffer, dateOffer, mealOffer, seatOffer, membOffer, specOffer, duraOffer;
- // values for offers (the ones with && offers)
- */
- /*
- 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).
- */
- /*
- //Class conditions
- if (clOffer == 1 && membOffer == 1)
- {
- cout << "Free WiFi" << endl;
- cout << "Airport Lounge Access" << endl;
- }
- else if (clOffer == 1)
- {
- cout << "Free WiFi" << endl;
- }
- else if (clOffer == 2 && membOffer == 1 || membOffer == 2)
- {
- cout << "Priority Boarding" << endl;
- }
- else if (clOffer == 3 && dateOffer == 1)
- {
- cout << "Your next flight booking is discounted" << endl;
- }
- else if (clOffer == 4 && seatOffer == 3)
- {
- cout << "Free Neck Pillow" << endl;
- }
- else if (clOffer == 4 && membOffer == 3)
- {
- cout << "5% discount of flight meals" << endl;
- }
- break;
- //Duration offer
- if (duraOffer == 1 && seatOffer == 1)
- {
- cout << "Blanket and headphones" << endl;
- cout << "Free drink voucher" << endl;
- }
- else if (duraOffer == 1 && seatOffer == 2)
- {
- cout << "Blanket and headphones" << endl;
- cout << "Provided sleeping kit" << endl;
- }
- else if (duraOffer == 1)
- {
- cout << "Blanket and headphones" << endl;
- }
- else if (duraOffer == 2 && seatOffer == 2)
- {
- cout << "Entertainment system with charging port" << endl;
- }
- else if (duraOffer == 3 && mealOffer == 2 || mealOffer == 3)
- {
- cout << "Complimentary snack box" << endl;
- }
- break;
- */
- /*
- switch (membOffer)
- {
- case '1':
- cout << "Free WiFi" << endl;
- case '2':
- cout << ""
- case '3':
- case 'B':
- case 'b':
- smemb = "Bronze";
- membOffer = 3;
- break;
- case '4':
- case 'N':
- case 'n':
- smemb = "Unavailable";
- membOffer = 4;
- break;
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement