//flightinfo.cpp -- assignment 3, summer 2001 //author: Rebecca Price, id: XXXXXXX, section: AA, TA: Man Chun Liu #include "flightinfo.h" // default constructor Flight::Flight(){ flightNum = "00000"; departLoc = ""; arrivalLoc = ""; departTime = "00:00"; arrivalTime = "00:00"; departDate = "00/00/00"; price = 0.00; // all new flights are Not canceled by default canceledFlight = false; } // copy constructor Flight::Flight(Flight& other){ copy(other); } // overloaded operator that sets a new instance of Flight to // the info in the instance other Flight& Flight::operator =(const Flight& other){ if(this != &other){ copy(other); } return *this; } // copies the info in instance other into a new instance of flightArray void Flight::copy(const Flight& other){ assert(other.flightNum!="00000"); flightNum = other.flightNum; departLoc = other.departLoc; arrivalLoc = other.arrivalLoc; departTime = other.departTime; arrivalTime = other.arrivalTime; departDate = other.departDate; price = other.price; canceledFlight = other.canceledFlight; } // overload operator == to check if certain elements of instance flightArray // match those of instance other bool Flight::operator ==(const Flight& other){ if((GetDepartureLoc() == other.GetDepartureLoc()) && (GetArrivalLoc() == other.GetArrivalLoc()) && (GetDepartDate() == other.GetDepartDate())) return true; return false; } // destructor Flight::~Flight(){ //I do nothing of importance in this project. } // prints out the info of a flight. prints out all seven variables void Flight::PrintInfo() const{ cout<