I am somewhat new to programming but I really love attacking new problems. A recent project I am working on involve implementing a calendar based on this input:

1.) The year you want a calendar for, like say 1992, etc.

2.) The day of the week that January 1st falls on(represented by 0-6. (Tuesday = 2).

This is not a homework assignment as I am out of school and have been for a couple years. I would really just love some hints and help on getting started on this problem. Here is what I know so far which is obvious information and are given with the problem in the book I purchased.

a.) Each successive month starts on the day of the week that follows the last day of the preceding month.

b.) Days of the week should be numbered 0-6 for Sunday through Saturday.

c.) Years that are divisible by four are leap years.

Here is a sample input and output:

INPUT

=======================================

What year do you want a calendar for? 1985

What day of the week does January 1st fall on (0-6)? 2

OUTPUT

=======================================

January

S M T W T 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

.....etc. with the following months to December for that year.

I hope somone can help a little with this so I can continue learning. Thanks .

2) That extends to being able to programmatically find which day of the week any given date falls on. Hence,

3) It would be easier to build a routine to generate a single month calendar, then just call it 12 times.

4) Keep calendar calulations seperate from calendar display.

5) To facilitate calendar, base everyting on a a 6x7 array, i.e., six 7-day weeks, initialized to zero, then filled with the day of month numbers:

Get day of week for the first of that month, determine the number of days in that month, then fill in the array.

To be fancy, use negative numbers to indicate day of month numbers for those portions of the previous and next months that would appear on that page - the calendar print routine could then ignore negatives or display them dimmer and/or smaller.