< previous page page_874 next page >

Page 874
Set (In: newMonth, newDay, newYear)
Set mo = newMonth
Set day = newDay
Set yr = newYear

3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Month()
Out: Function value
Return mo

3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Day()
Out: Function value
Return day

3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Year()
Out: Function value
Return yr

Testing: The Month, Day, and Year observer functions can be used to verify that the class constructor and Set functions work correctly. The code
DateType someDate;

cout << someDate.Month() <   < someDate.Day() <  
     < someDate.Year() < endl;
should print out 1 1 1583. To test the Set function, it is sufficient to set a DateType object to a few different values (obeying the precondition for the Set function), then print out the month, day, and year as above.

 
< previous page page_874 next page >