Connecting Tech Pros Worldwide Forums | Help | Site Map

date programme

Newbie
 
Join Date: Apr 2007
Posts: 17
#1: Apr 21 '07
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's Avatar
Expert
 
Join Date: Feb 2007
Posts: 839
#2: Apr 21 '07

re: date programme


Quote:

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?
Newbie
 
Join Date: Apr 2007
Posts: 17
#3: Apr 21 '07

re: date programme


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
Ganon11's Avatar
Moderator
 
Join Date: Oct 2006
Location: New York, United States of America
Posts: 3,428
#4: Apr 21 '07

re: date programme


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.
Reply