问答题
【C++程序】
#include<iostream>
using namespace std;
(1) MonthJan,Feb,Mar,Art,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec;
class Date{
public:
Date(int year,Month m_month){
(2) =year;
if (m_month<Jan‖m_month>Dec) month=Jan;
else month=m_month;
};
~Date()};
bool IsLeapYear(){
return ((year%4==0 && year%1001!=0)‖year%400==0);
};
int CaculateDays(){
switch( (3) ){
case Feb:
if( (4) )return29;
e1Se return 28;
}
case Jan:case Mar:case May:case Jul:case AUg:case Oct:
case Dec:retllrn 31;
case Apr:case Jun:Case Sep:case Nov:roturu30;
}
};
private:
int year;
Month month;
};
void main(){
Date day(2000,Feb);
tout<<day. (5) ();
}
(1)enum
(2)this->year
(3)month
(4)IsLeapYear()
(5)Cacu lateDays