//********************************************************************
// datetype.cpp
// Author: Thomas C. Bressoud
// Date: 2 February 2006
// Class: CS 173-01, Professor Bressoud
// Purpose: This file defines the implementation of the DateType class
//          as given in its corresponding header file
//********************************************************************
#include "datetype.h"

//******************************************************************
// Constructor
// DateType( int newMonth, int newDay, int newYear )
// Purpose: Constructor for DateType class type objects
// Output: creation of an object
// Precondition: 1 <= newMonth <= 12
//               newDay in range for given month
// Postcondition: object data members are initialized with given
//                month, day, and year
//******************************************************************
DateType::DateType(int newMonth, int newDay, int newYear)
{
    month = newMonth;
    day = newDay;
    year = newYear;
}

//******************************************************************
// reInitialize( int newMonth, int newDay, int newYear )
// Purpose: Update a DateType object with new values for day
//          month, and year
// Output: none
// Precondition: 1 <= newMonth <= 12
//               newDay in range for given month
// Postcondition: object data members are updated with given
//                month, day, and year
//******************************************************************    
void DateType::reInitialize(int newMonth, int newDay, int newYear)
{
    month = newMonth;
    day = newDay;
    year = newYear;
}

//******************************************************************
// int getYear()
// Purpose: Return the internal state of the year for the current
//          DateType object
// Output: object year
// Precondition: none
// Postcondition: value of year
//******************************************************************    
int DateType::getYear() const
{
    return year;
}

//******************************************************************
// int getMonth()
// Purpose: Return the internal state of the month for the current
//          DateType object
// Output: object month
// Precondition: none
// Postcondition: value of month
//******************************************************************    
int DateType::getMonth() const
{
    return month;
}

//******************************************************************
// int getDay()
// Purpose: Return the internal state of the day for the current
//          DateType object
// Output: object day
// Precondition: none
// Postcondition: value of day
//******************************************************************    
int DateType::getDay() const
{
    return day;
}

