#include #include #include "date.h" //so that main.C can mention date using namespace std; int main() { cout << "A year has " << date::monthsInYear() << " months.\n"; //Output the date of Independence Day. const date independenceDay {7, 4, 1776}; //month, day, year independenceDay.print(); cout << " is Independence Day.\n"; //Output today's date. const date today; //Call the default constructor today.print(); //Should output today's date cout << " is today.\n"; //Output tomorrow's date. date tomorrow {today}; //Call the "copy constructor". tomorrow.next(); //Advance one day. tomorrow.print(); cout << " is tomorrow.\n"; //Output the date that is one week from today. date nextWeek {today}; //Call the "copy constructor". nextWeek.next(7); nextWeek.print(); cout << " is next week.\n"; //Output yesterday's date. date yesterday {today}; yesterday.prev(); //Go back one day. yesterday.print(); cout << " was yesterday.\n"; //Output the date that was one week before today. date lastWeek {today}; lastWeek.prev(7); //Go back one week. lastWeek.print(); cout << " was last week.\n"; //Output the date of New Year's Eve. date newYearsEve {1, 1, 2027}; //month, day, year newYearsEve.prev(); newYearsEve.print(); cout << " will be New Year's Eve.\n"; //Output the date that was a year ago today. date aYearAgo {today}; aYearAgo.prev(365); aYearAgo.print(); cout << " was a year ago.\n"; return EXIT_SUCCESS; }