//Another Client Program to demonstrate the class DayOfYear. #include using namespace std; #include "DayOfYear.h" bool IsSame (DayOfYear one, DayOfYear another) { if ( one.month == another.month && one.day == another.day ) return true; else return false; } bool IsBefore (DayOfYear one, DayOfYear another) { if ( one.get_month( ) < another.get_month() || one.get_month() == another.get_month() && one.get_day() < another.get_day() ) return true; else return false; } int main( ) { DayOfYear* pToday; DayOfYear* pBach_birthday; cout << "Enter today's date:\n"; pToday = new DayOfYear (11,5); (*pToday).input( ); cout << "Today's date is "; pToday->output( ); pBach_birthday = new DayOfYear (3,21); pBach_birthday->set(3, 21); cout << "J. S. Bach's birthday is "; pBach_birthday->output( ); if (IsSame (*pToday, *pBach_birthday)) cout <<"Happy birthday, Bach!\n"; else cout <<"Happy unbirthday, Bach!\n"; DayOfYear dates[10]; cout <<"Enter 10 dates:"; for (int i=0;i<10;i++) dates[i].input(); return 0; }