date.cc - /* The implementation file for the date class...

This preview shows page 1 - 2 out of 3 pages.

/*************************************************************************The implementation file for the date class including theimplementation of overloaded insertion and extraction andcomparison operators.John DolanOhio University EECSSeptember 2005Patricia LindnerOhio University EECSAugust 2021*************************************************************************/#include "date.h"using namespace std;// default constructorDate::Date(){day=month=year=1;// permissable days for each month are loaded into an arraydaysallowed[0] = 0;daysallowed[1] = 31;daysallowed[2] = 29;daysallowed[3] = 31;daysallowed[4] = 30;daysallowed[5] = 31;daysallowed[6] = 30;daysallowed[7] = 31;daysallowed[8] = 31;daysallowed[9] = 30;daysallowed[10] = 31;daysallowed[11] = 30;daysallowed[12] = 31;}// constructor that takes three argumentsDate::Date(int d,int m, int y):day(d),month(m),year(y){// permissable days for each month are loaded into an arraydaysallowed[0] = 0;daysallowed[1] = 31;daysallowed[2] = 29;daysallowed[3] = 31;daysallowed[4] = 30;daysallowed[5] = 31;daysallowed[6] = 30;daysallowed[7] = 31;daysallowed[8] = 31;daysallowed[9] = 30;daysallowed[10] = 31;daysallowed[11] = 30;daysallowed[12] = 31;}// output operator, overloaded as a friend function

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 3 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Spring
Professor
johndolan
Tags
Equals sign, relational operator, John Dolan, Ohio University EECS, Patricia Lindner Ohio University EECS

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture