< previous page page_878 next page >

Page 878
//******************************************************************
// IMPLEMENTATION FILE (datetype.cpp)
// This file implements the DateType member functions
//******************************************************************
#include datetype.h
#include bool.h
#include <iostream.h>

// Private members of class:
//     int mo;
//     int day;
//     int yr;

int DaysInMonth( int, int );  // Prototype for auxiliary function

//******************************************************************

DateType::DateType()

// Constructor

// Postcondition:
//     mo == 1  &&  day == 1 &&  yr == 1583

{
    mo = 1;
    day = 1;
    yr = 1583;
}

//******************************************************************

void DateType::Set( /* in */ int newMonth,
                    /* in */ int newDay,
                    /* in */ int newYear  )

// Precondition:
//     1 <= newMonth <= 12
//  && 1 <= newDay <= maximum no. of days in month newMonth
//  && 1582 < newYear
// Postcondition:
//     mo == newMonth   &&  day == newDay  &&  yr == newYear

{
    mo = newMonth;
    day = newDay;
    yr = newYear;
}

 
< previous page page_878 next page >