In C++ Consider the following Date class: #include <iostream> using namespace st
ID: 665315 • Letter: I
Question
In C++
Consider the following Date class:
#include <iostream>
using namespace std;
class MyDate
{
private:
int month, day, year;
public:
MyDate() {setDate(2,27,2006);}
MyDate(int, int, int);
void setDate(int mm, int dd, int yyyy);
void showDate();
};
MyDate::MyDate(int mm, int dd, int yyyy)
{
month = mm;
day = dd;
year = yyyy;
};
void MyDate::setDate(int mm, int dd, int yyyy)
{
month = mm;
day = dd;
year = yyyy;
};
void MyDate::showDate()
{
cout << "The date is " << month << "/" << day << "/" << year% << endl;
};
END HERE...
Write a test main that will create two date instances date1 inititalized to April, 17, 2012 and date2 that is set to today, then show both dates with each display on its own line.