Code Fragment: Constructors



Passenger::Passenger() {		// default constructor
  name = "--NO NAME--";
  mealPref = NO_PREF;
  isFreqFlyer = false;
  freqFlyerNo = "NONE";
}
					// constructor given member values
Passenger::Passenger(const string& nm, MealType mp, string ffn) {
  name = nm;
  mealPref = mp;
  isFreqFlyer = (ffn != "NONE");	// true only if ffn given
  freqFlyerNo = ffn;
}
					// copy constructor
Passenger::Passenger(const Passenger& pass) {
  name = pass.name;
  mealPref = pass.mealPref;
  isFreqFlyer = pass.isFreqFlyer;
  freqFlyerNo = pass.freqFlyerNo;
}