// fourth version of the 'date' class
// - added cache of string form of the date
// - added destructor

#include "date4.h"

// constructor
date::date(int d, int m, int y)
{
    day = d;
    month = m;
    year = y;
    
    // insert code here to determine the string form of the date
    char *dateStr = ?;
    str = new char[strlen(dateStr) + 1];
    strcpy(str, dateStr);
}

// constructor
date::date(char *dateStr)
{
    str = new char[strlen(dateStr) + 1];
    strcpy(str, dateStr);
    
    // insert code here to parse string to get DMY
    day = ?;
    month = ?;
    year = ?;
}

// destructor
date::~date()
{
    delete[] str;
}

void date::getDMY(int *ptr_day, int *ptr_month, int *ptr_year)
{
    *ptr_day = day;
    *ptr_month = month;
    *ptr_year = year;
}

void date::increment()
{
    if (++day > 28)
    {
        // do the hard part
    }
}

void date::print()
{
    cout << day << ¹/¹ << month << ¹/¹ << year;
}

int currentYear()
{
    // insert code here to determine the current year
    int currYear = ?;
    return currYear;
}

