#include #include using namespace std; class Party { private: string person = "P"; string organization = "O"; public:; string address; double phoneNumber; }; class Person: public Party { public: string dateOfBirth; string firstName; string lastName; }; class Passenger: public Person { public: string ticketNumber; string frequentFlyer; double ticketPrice; string flightNumber; string seat; }; int main() { Passenger info; string status; char buy; int choice; cout << "Would you like to buy a ticket?\n"; cout << "Please enter a Y for yes, if you would like a ticket: " << endl; cin >> buy; if (buy == 'Y' || buy == 'y') { status = "T"; cout << "Please enter the following information:"; cout << endl; cout << "What is the passenger's first name?"; cin >> info.firstName; cout << "What is the passenger's last name?"; cin >> info.lastName; cout << "What is the passenger's date of Birth? Please use mm/dd/yy format."; cin >> info.dateOfBirth; cin.ignore(); cout << "What is the passenger's address?"; getline(cin, info.address); cout << "What is the passenger's phone number?"; cin >> info.phoneNumber; cin.ignore(); cout << "Enter the passenger's ticket number: "; getline(cin, info.ticketNumber); cout << "Enter the passenger's frequent flyer number: "; getline(cin, info.frequentFlyer); cout << "Enter the passenger's ticket price: "; cin >> info.ticketPrice; cin.ignore(); cout << "Enter the passenger's flight number: "; getline(cin, info.flightNumber); cout << "Enter the passenger's seat assignment: "; getline(cin, info.seat); cout << endl; cout << "Current information for passenger: " << endl; cout << "First Name: " << info.firstName << endl; cout << "Last Name: " << info.lastName << endl; cout << "Date of Birth: " << info.dateOfBirth << endl; cout << "Address: " << info.address << endl; cout << "Phone Number: " << info.phoneNumber << endl; cout << "Ticket Status: " << status << endl; cout << "Ticket Number: " << info.ticketNumber << endl; cout << "Frequent Flyer Number:" << info.frequentFlyer << endl; cout << "Ticket AirFare Price:" << info.ticketPrice << endl; cout << "Flight Number: " << info.flightNumber << endl; cout << "Current Seat Assignment: " << info.seat << endl; cout << endl; do { cout << "The following are your choices.\n"; cout << "Please make your selection: \n"; cout << endl; cout << "1. Change seat assignment\n"; cout << "2. Cancel your ticket\n"; cout << "3. Quit Program\n"; cin >> choice; while (choice < 1 || choice > 3) { cout << "The valid choices are 1 through 3. Please\n" << "select one of those." << endl; cin >> choice; } switch (choice) { case 1: cout << "Your current seat assigment is " << info.seat << "."; cout << endl; cout << "Which seat would you like to change to: "; cin >> info.seat; cout << "Your new seat assignment: " << info.seat << "." << endl; cout << "First name: " << info.firstName << endl; cout << "Last name: " << info.lastName << endl; cout << "address: " << info.address << endl; cout << "Ticket status: " << status << endl; cout << endl; break; case 2: cout << "Your ticket has been canceled.\n"; status = "C"; cout << "First name: " << info.firstName << endl; cout << "Last name: " << info.lastName << endl; cout << "Ticket status: " << status << endl; break; case 3: cout << "Thank you for using this program.\n"; cout << "Have a nice Day.\n"; cout << endl; } }while (choice == 1); } else return 0; }