Assignment 7 - Constructing Dates

due  Tuesday, March 6th

The purpose of this assignment is to give you practice using constructors and destructors.


Program Requirements

Create a Date class containing:
int*  month;    
int*  day;    
int*  year;
You may use these two named constants:
const string Months[13] = {"","January","February","March","April","May","June","July","August","September","October","November","December"};
const int CurrentYear = 2018;

You may use this one global variable:
int DaysPerMonth[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};

Use the following main():

int main()
{
    Date today;
    Date todayCopy(today);
    Date feb2815(2,28,15);            // assume the year is 2015
    Date assignmentDueDate(3,6);      // assume the year is the Current Year
    Date feb2895("02-28-95");         // assume the year is 1995
    Date newYearsDay("01/01/18");     // assume the year is 2018
    Date idesOfMarch(74);             // assume the year is the Current Year
    Date eoy(365);                    // assume the year is the Current Year

    cout << "Today: "; today.print();
    cout << "Today: "; todayCopy.print();
    cout << "feb2815: "; feb2815.print();
    cout << "Assignment due date: "; assignmentDueDate.print();
    cout << "feb2895: "; feb2895.print();
    cout << "New Years Day: "; newYearsDay.print();
    cout << "Ides of March: "; idesOfMarch.print();
    cout << "Last Day of Year: "; eoy.print();

    cout << "Today: "; today.print_long();
    cout << "Today: "; todayCopy.print_long();
    cout << "feb2815: "; feb2815.print_long();
    cout << "Assignment due date: "; assignmentDueDate.print_long();
    cout << "feb2895: "; feb2895.print_long();
    cout << "New Years Day: "; newYearsDay.print_long();
    cout << "Ides of March: "; idesOfMarch.print_long();
    cout << "Last Day of Year: "; eoy.print_long();
}

Assumptions


Program Output

Your output should look like the following.  

Today: 01/02/18                                   <=== This will be the current date
Today: 01/02/18                                   <=== This will be the current date
feb2815: 02/28/15
Assignment due date: 03/06/18
feb2895: 02/28/95
New Years Day: 01/01/18
Ides of March: 03/15/18
Last Day of Year: 12/31/18
Today: January 2, 2018                    <=== This will be the current date
Today: January 2, 2018                    <=== This will be the current date
feb2815: February 28, 2015
Assignment due date: March 6, 2018
feb2895: February 28, 1995
New Years Day: January 1, 2018
Ides of March: March 15, 2018
Last Day of Year: December 31, 2018