date programme

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • appy
    New Member
    • Apr 2007
    • 17

    date programme

    hi everyone,
    would u please help me! i want to write programme that contain 3 files, 2 with cpp suffix (like date.cpp & testDate.cpp) and 1 with h suffix(like date.h), i want to write function prototype in date.h file and put down main function in testDate.cpp file and put down trunk of function in date.cpp file.
    i want the programme operates like this:if i put xth day of year , it gives me date of that day and on the contrary.
    what function should i use? and what should i write in main function?
    thanks
  • ilikepython
    Recognized Expert Contributor
    • Feb 2007
    • 844

    #2
    Originally posted by appy
    hi everyone,
    would u please help me! i want to write programme that contain 3 files, 2 with cpp suffix (like date.cpp & testDate.cpp) and 1 with h suffix(like date.h), i want to write function prototype in date.h file and put down main function in testDate.cpp file and put down trunk of function in date.cpp file.
    i want the programme operates like this:if i put xth day of year , it gives me date of that day and on the contrary.
    what function should i use? and what should i write in main function?
    thanks
    Hi,
    What have you tried? You want the function to give you the date of a certain day, right? From main you should call your function and it should return a value and you then print that value out in main. What have you done so far on writing the function?

    Comment

    • appy
      New Member
      • Apr 2007
      • 17

      #3
      thanks alot for ur guidance
      yea, u,r right!
      would u please tell me what function should i use?and how? or introduce me some useful site that can help me to write this programme
      thanks again

      Comment

      • Ganon11
        Recognized Expert Specialist
        • Oct 2006
        • 3651

        #4
        You should probably use your own function. You'll have to come up with the logic to determine the date depending on the day number. You should consider how many days are in each month and whether or not the given year is a leap year.

        Comment

        Working...