A broad mathematical idea is to find out the day of the week on a specific day. Each time you print a month, you must pick up the start of the right week / day on the first day of that month. As usual, Wikipedia has the answer:
http://en.wikipedia.org/wiki/Calculating_the_day_of_the_week
You will also need to consider leap years to make sure you type February correctly.
source
share