#include <iostream>
using namespace std;
class Day
{
public:
void input();
void output();
void set(int new_month,int new_day);
int get_month();
int get_day();
private:
void check_date();
int month;
int day;
};
int main()
{
Day day1;
day1.input ();
day1.output ();
return 0;
}
void Day::input ()
{
cout<<"Please inter the month:";cin>>month;
cout<<"Please inter the day:";cin>>day;
check_date();
}
void Day::output ()
{
cout<<"The month is:"<<month<<",The day is:"<<day<<endl;
}
void Day::set (int new_month,int new_day)
{
month=new_month;
day=new_day;
check_date();
}
int Day::get_day ()
{
return day;
}
int Day::get_month ()
{
return month;
}
void Day::check_date ()
{
if(day<1||day>31) cout<<"Illegal date: day\n";
if(month<1||month>12) cout<<"Illegal date: month\n";
}
using namespace std;
class Day
{
public:
void input();
void output();
void set(int new_month,int new_day);
int get_month();
int get_day();
private:
void check_date();
int month;
int day;
};
int main()
{
Day day1;
day1.input ();
day1.output ();
return 0;
}
void Day::input ()
{
cout<<"Please inter the month:";cin>>month;
cout<<"Please inter the day:";cin>>day;
check_date();
}
void Day::output ()
{
cout<<"The month is:"<<month<<",The day is:"<<day<<endl;
}
void Day::set (int new_month,int new_day)
{
month=new_month;
day=new_day;
check_date();
}
int Day::get_day ()
{
return day;
}
int Day::get_month ()
{
return month;
}
void Day::check_date ()
{
if(day<1||day>31) cout<<"Illegal date: day\n";
if(month<1||month>12) cout<<"Illegal date: month\n";
}