Year Class Reference

#include <Year.h>

Inheritance diagram for Year:

LeapYear List of all members.

Detailed Description

Class Year is a misnamed class that holds a complete date and permits several operations on it, most notably the ability to find how many days elapsed in that year


Public Member Functions

 Year ()
 Year (int monthVal, int dayVal, int yearVal)
virtual int daysElapsed ()

Static Public Member Functions

static int getDaysInYear ()
static double percentOfYear (int daysElapsed)
static bool isLeapYear (int Year)

Protected Attributes

int month
int day
int year

Static Protected Attributes

static int daysInYear = 365


Constructor & Destructor Documentation

Year::Year (  ) 

Default Constructor: Do nothing

Year::Year ( int  monthVal,
int  dayVal,
int  yearVal 
)

Constructor: Mutator: Set the date components

Parameters:
monthVal month
dayVal day
yearval year


Member Function Documentation

int Year::daysElapsed (  )  [virtual]

Facilitator: Determine days elapsed from data members

Returns:
Days elapsed in year

Reimplemented in LeapYear.

int Year::getDaysInYear (  )  [static]

Static, as the value is the same for all non-leap years

Returns:
Days in a non-leap year

bool Year::isLeapYear ( int  Year  )  [static]

Determine if a year is a leap year Static, so it must take the year as an argument (Why??)

Returns:
whether leap year

double Year::percentOfYear ( int  daysElapsed  )  [static]

Facilitator - static; same for all non-leap years

Returns:
day as percent of year


Member Data Documentation

int Year::day [protected]

int Year::daysInYear = 365 [static, protected]

int Year::month [protected]

int Year::year [protected]


The documentation for this class was generated from the following files:
Generated on Wed Mar 17 16:50:14 2010 for Days Elapsed In Year Doxygen Example by  doxygen 1.4.7