/* ECP: FILEname=fig14_12.cpp */ /* 1*/ Date::Date( int Y, int M, int D ) /* 2*/ { /* 3*/ SetJan1Array( ); /* 4*/ // Simplistic algorithm; no error checks. /* 5*/ TotalDays = DaysTillJan1[ Y - FirstYear ]; /* 6*/ TotalDays += DaysTillFirstOfMonth[ M ]; /* 7*/ TotalDays += D; /* 8*/ TotalDays += IsLeap( Y ); /* 9*/ }