-
Display a month calander
Good Morning Everyone:
I need to find some sample code for an assignment that is due tonight but I'm not having much luck. Here are my instructions:
Write a void function named displayCalendarDays. This function is passed two input parameters. The first parameter is an int that represents the start day. Start days are numbered from 0 to 6 with 0 representing Sunday and 6 representing Saturday. The second parameter is an int that represents the number of days in the month. If the start day is not in the range 0 to 6 or if the number of days is not in the range 1 to 31, the program should display a helpful error message instead of displaying a calendar. If the parameters are OK, the program should display a calendar similar to the following:
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
After the last day of the calendar is displayed, the function should advance the cursor to the next line.
Note that for the display above, the start day is 3 and the numbers of days is 31.
Would someone please point me in the right direction? I am having a problem here the day alignment will not display correctly when the thread posts, the 1st should be on wensday.
-
I would start with the input and the error messages. Once you have the program checking the input parameters properly you can move on to the second phase which is displaying the calendar. Do you have any working code so far?
-
problem resolved thanks for the input