36 lines
705 B
C++
36 lines
705 B
C++
#include <iostream>
|
|
#include "DateType.h"
|
|
|
|
using namespace std;
|
|
void DateType::Initialize (int newMonth, int newDay, int newYear)
|
|
{
|
|
year=newYear;
|
|
month=newMonth;
|
|
day=newDay;
|
|
}
|
|
|
|
int DateType::GetMonth() const
|
|
{
|
|
return month;
|
|
}
|
|
|
|
int DateType::GetYear() const
|
|
{
|
|
return year;
|
|
}
|
|
|
|
int DateType::GetDay() const
|
|
{
|
|
return day;
|
|
}
|
|
|
|
int main()
|
|
{
|
|
DateType today;
|
|
DateType anotherDay;
|
|
today.Initialize(9,24,2003);
|
|
anotherDay.Initialize(9,25,2003);
|
|
|
|
cout << "Today is " << today.GetMonth() << "/" << today.GetDay() << "/" << today.GetYear()<< endl;
|
|
cout << "Another date is " << anotherDay.GetMonth() << "/" << anotherDay.GetDay() << "/" << anotherDay.GetYear() << endl;
|
|
} |