#include "stdstuff.h" #include "Date.h" int main () { const int MAXVACATIONS = 100; vacationInfo vacations[MAXVACATIONS]; int actualVacations, minDays, maxDays; Date firstDate, lastDate; String2002 keyword; if (!readVacationData (vacations, MAXVACATIONS, actualVacations)) { cout << "Unable to read in vacation information.\n"; pause (); return 0; } for (;;) { cout << "\nPlease enter minimum and maximum duration (0 0 to stop): "; cin >> minDays >> maxDays; if ((minDays == 0) && (maxDays == 0)) { pause(); return 0; } cout << "Please enter earliest possible departure date (DD MM YYYY): "; firstDate.read (cin); cout << "Please enter latest possible return date (DD MM YYYY): "; lastDate.read (cin); cout << "Please enter keyword (NONE if none required): "; cin >> keyword; if (cin.fail()) { cin.clear(); cin.ignore(INT_MAX, '\n'); cout << "\nAn input error occured - please try again.\n"; } else { doVacationSearch (vacations, actualVacations, minDays, maxDays, firstDate, lastDate, keyword); } } }