//-------------------------------- // Savitch text display 6.3 // // Modified for CMSC 202 standards // //Program to demonstrate a very simple example of a class. //A better version of the class DayOfYear will be given in Display 6.4. // // Also note that a better (shorter) version of Output() is recommended //-------------------------------- #include #include "DayOfYear1.h" using namespace std; int main( ) { DayOfYear today, birthday; // ask user for today's date cout << "Enter today's date:\n"; cout << "Enter m_month as a number: "; cin >> today.m_month; cout << "Enter the m_day of the m_month: "; cin >> today.m_day; // ask user for their birthday cout << "Enter your birthday:\n"; cout << "Enter m_month as a number: "; cin >> birthday.m_month; cout << "Enter the m_day of the m_month: "; cin >> birthday.m_day; // echo user input cout << "today's date is "; today.Output( ); cout << endl; cout << "Your birthday is "; birthday.Output( ); cout << endl; // output special message if (today.m_month == birthday.m_month && today.m_day == birthday.m_day) cout << "Happy Birthday!\n"; else cout << "Happy Unbirthday!\n"; return 0; }