1
0
UAHCode/CPE212/Project 1.1/DateType.cpp

36 lines
705 B
C++
Raw Permalink Normal View History

2022-08-28 21:12:16 +00:00
#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;
}