The files you must submit for this homework are exactly "calendar.cpp" and "calendar.scr" (containing a script of your source code, compilation, and test runs, in that order).
You are to write 5 of the functions in a calendar program. The program takes as input any four digit year after 1899 and outputs the calendar of that year. To see what it should look like you can try out the UNIX program cal. To do this just type "cal year_no", for example "cal 1977". Your program will do the same thing except that the months will be printed down the page rather than across.
You can find the detailed outline of the program here or in the file ~homer/hw2.cpp on csa.
You will need to write the 5 functions indicated. They are GetYearFromUser, IndentFirstLine, FirstDayOfMonth, MonthDays, and IsLeapYear.
The rule for leap years can be found in homework 1.
Check your program by running it on several different inputs. You should turn in the output from the years 2040 and 1997 (in that order) and one other year.
As a suggestion, give your executable (not to be submitted) a name like "calprog", since "cal" and "calendar" are already commands on the system.
Do not allow your work to be used by others:
Warning: If someone cheats by using your work, you will also be penalized
Page Created: May 25, 2002