The problem tells me:
"The class should have member functions to print the date in the following format"
- 3/15/13 //showShortDate
- March 13, 2013 //showLongDate
- 15 March, 2013 //showEuroDate
The following in the function implementation file will not compile and give a "cout : undeclared identifier"
error. I have #include <iostream>
in the main program .cpp file.
// Date.cpp is the Date class function implementation file
#include "Date.h"
Date::Date(int m, int d, int y)
{ month = m;
day = d;
year = y;
}
Date::Date()
{
month = 1;
day = 1;
year = 2001;
}
void Date::showShortDate()
{
cout << month << "/" << day << "/" << year;
}
void Date::showLongDate()
{
cout << month << " " << day << ", " << year;
}
void Date::showEuroDate()
{
cout << day << " " << month << " " << year;
}