CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2012
    Posts
    7

    Display a monthly calendar

    Good Morning:
    I need to write a function that displays the days of a specified month. I have been looking for sample code but haven't had much luck. Here are the guidelines for the function:

    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.

    Can someone please help me with this? The posting format is off the month should start on wensday.
    Last edited by Les2012; December 5th, 2012 at 09:42 AM. Reason: formatting problem

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Display a monthly calendar

    Quote Originally Posted by Les2012 View Post
    Can someone please help me with this?
    Yes, of course!
    Show us what you have already done (your code) and explain what problems do you have and with what parts?
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured