Lab
Calendar

Objective
To design a large program using various C++ skills and the technique of structure charts.

Assignment
Print a calendar for one month when the user enters the year, month and starting day.

Sample Run
Enter the year: 1996

January..........1
February.........2
:
December........12

Enter the month: 7

Sunday...........0
Monday...........1
:
Saturday.........6

Enter the starting day: 1

	   July
 S  M  T  W  R  F  S
    1  2  3  4  5  6
 7  8  9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31

Hints

  1. Draw a structure chart to help you organize your solution strategy.
  2. Decide what information is entered and what the computer will figure out.
  3. Decide how to handle leap year.

Extensions

  1. Use the "Birthday Baffler" algorithm to find the starting day for a given month and year.
  2. "Box" your calendar.
               July
    ---+---+---+---+---+---+---
     S | M | T | W | R | F | S
    ---+---+---+---+---+---+---
       | 1 | 2 | 3 | 4 | 5 | 6
    ---+---+---+---+---+---+---
     7 | 8 | 9 |10 |11 |12 |13
    ---+---+---+---+---+---+---
    14 |15 |16 |17 |18 |19 |20
    ---+---+---+---+---+---+---
    21 |22 |23 |24 |25 |26 |27
    ---+---+---+---+---+---+---
    28 |29 |30 |31 |   |   |
    ---+---+---+---+---+---+---
    

    The Birthday Baffler On what day of the week were you born? Even if your parents don't remember, there's a way to find out. Just use the tables below and follow these directions. The people at the National Geographic Society who came up with this method guarantee it for any date between 1900 and 1999.

    Table Of Months
    January1 (0 in leap year)
    February4 (3 in leap year)
    March4
    April0
    May2
    June5
    July0
    August3
    September6
    October1
    November4
    December6

    Table Of Days
    Sunday1
    Monday2
    Tuesday3
    Wednesday4
    Thursday5
    Friday6
    Saturday0


    Continue to:  Unit 1  / Prev  / Next