Solved
C++, How to implement a calandar based on this input???
Posted on 2003-12-04
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 .