Display a month calander

This is a discussion on Display a month calander within the C++ Programming forums, part of the General Programming Boards category; Good Morning Everyone: I need to find some sample code for an assignment that is due tonight but I'm not ...

  1. #1
    Registered User
    Join Date
    Dec 2012
    Posts
    14

    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.
    Last edited by les2012; 12-05-2012 at 08:16 AM. Reason: formating problem

  2. #2
    Bored Programmer
    Join Date
    Jul 2009
    Location
    Tomball, TX
    Posts
    407
    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?

  3. #3
    Registered User
    Join Date
    Dec 2012
    Posts
    14
    problem resolved thanks for the input

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C Programs for Calendar (DIsplay Month and Year)
    By Karyumi in forum C Programming
    Replies: 4
    Last Post: 03-04-2012, 05:12 AM
  2. Display day, month, year in different format
    By melodious in forum C++ Programming
    Replies: 5
    Last Post: 07-05-2007, 02:14 AM
  3. About the Calander control 10.0
    By frankiepoon in forum Windows Programming
    Replies: 0
    Last Post: 10-16-2002, 10:50 PM
  4. calander
    By Unregistered in forum C Programming
    Replies: 10
    Last Post: 02-03-2002, 08:56 AM
  5. extending a month calander to a year
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 02-03-2002, 06:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21