IUP Computer Science
CO 310 Spring 1997

Project 2
(Due   18 Feb 1997)

Many holidays are held on a particular day of the week, in a particular month - for example, Labor Day is always the first Monday in September. For project #2, your task is to write a program that will display the dates for several holidays and other events during any year between 1801 and 2099. You are given a date class to help you in doing this task - the definition of the class and its member functions are in the file DATECLS.H. Copy DATECLS.H from 310LIB, O:\JLW\310 or L:\jlw\310 to your disk and use an "include" to refer to it. DO NOT CHANGE DATECLS.H AT ALL.

Your program should repeatedly prompt for a year and then display the following information: 1) The date and day number (within the year) of President's Day (third Monday of February), Labor Day (first Monday of September), and Thanksgiving (fourth Thursday of November); 2) The dates of all Friday the 13ths during the year. For 1997, the display should look something like this:

President's Day:  17 Feb 1997  (day 48)
Labor Day:  1 Sep 1997  (day 244)
Thanksgiving:  27 Nov 1997  (day 331)

Friday the 13ths during 1997:  13 Jun 1997

The program should terminate when an invalid year is entered. Note: These holidays did not exist during the entire range of possible years - ignore this fact.

The date class provides all the functions that you will need to do this project (and more). Following is a brief example to illustrate the interface to the date class.

date      now (14,2,1997);   // Valentine's Day (note day is first)
date      other;             // Initialize to starting date
int      wd, md, dif;
other = now + 40;            // Make other the date 40 days after Val. Day
wd = other.weekday();        // Make wd the weekday number of that date
md = other.monthday();       // Make md the day of the month of other
if (other < date(27,3,1997)  // Determine if other comes before 27 March
   cout << other;            // If yes, output other as dd mmm yyyy
if (other == date(30,3,1997) // Determine if other has the value 30 March,
   dif = (other - now)*2;    // if yes, assign dif twice the number of
                             //   days between other and now

Hand in a disk with a file named you-p2.cpp (where "you" is your initials) that represents your solution to this project.  Also, 
hand in a printout of this file.