*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*

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

*Extensions*

- Use the "Birthday Baffler" algorithm to find the starting day for a given month and year.
- "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 | | | ---+---+---+---+---+---+---

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.*The Birthday Baffler*- Start with the last two digits of the year in which you were born.
- Divide the above number by 4, dropping the remainder if there is one.
- Find the number associated with the month in which you were born in the TABLE OF MONTHS.
- On which day of the month is your birthday?
- Find the sum of the numbers obtained in the first four steps.
- Divide the sum by the number 7. The day that corresponds to the remainder in the TABLE OF DAYS is the day of the week you were born on.

**Table Of Months**

January 1 (0 in leap year) February 4 (3 in leap year) March 4 April 0 May 2 June 5 July 0 August 3 September 6 October 1 November 4 December 6 **Table Of Days**

Sunday 1 Monday 2 Tuesday 3 Wednesday 4 Thursday 5 Friday 6 Saturday 0

Unit 1 / Prev / Next*Continue to:*