#include #include #include using namespace std; class Appointment { private: int month; int day; int year; int hour; int minute; bool isam; string description; public: Appointment(int n_month, int n_day, int n_year, int n_hour, int n_minute, bool n_isam, string n_description) { month = n_month; day = n_day; year = n_year; hour = n_hour; minute = n_minute; isam = n_isam; description = n_description; } int getYear() {return year;} int getMonth() {return month;} int getDay() {return day;} int getHour() {return hour;} int getMinute() {return minute;} bool getIsAm() {return isam;} bool isLess(Appointment toCompare) { if((year < toCompare.getYear()) || (year == toCompare.getYear() && month < toCompare.getMonth()) || (year == toCompare.getYear() && month == toCompare.getMonth() && day < toCompare.getDay()) || (year == toCompare.getYear() && month == toCompare.getMonth() && day == toCompare.getDay() && isam == true && toCompare.getIsAm() == false) || (year == toCompare.getYear() && month == toCompare.getMonth() && day == toCompare.getDay() && (isam == toCompare.getIsAm()) && hour < toCompare.getHour()) || (year == toCompare.getYear() && month == toCompare.getMonth() && day == toCompare.getDay() && (isam == toCompare.getIsAm()) && hour == toCompare.getHour() && minute < toCompare.getMinute())) { return true; } else { return false; } } };