R
Russell
I have an assignment that I have to complete. I have to write a
windows app in C#. Here is the spec:
1/ Date Comparison
Build a program that will find the number of days between two dates.
You CANNOT use the inbuilt date functions or the DateTime Type. Your
program should work with any date between 1900 and 3000.
Here are your acceptance tests:
Days between 04/01/02 and 01/01/02 equals 3
Days between 01/05/1998 and 12/10/1977 equals 7506
Days between 01/01/2004 and 01/01/2003 equals 365
Days between 01/01/2002 and 01/01/2000 equals 731
I figure I could convert the dates to doubles and then subtract one
from the other but that wouldnt take leap years into account!!
Any ideas to get me started would be really appreciated!!
thanks
RuSs
windows app in C#. Here is the spec:
1/ Date Comparison
Build a program that will find the number of days between two dates.
You CANNOT use the inbuilt date functions or the DateTime Type. Your
program should work with any date between 1900 and 3000.
Here are your acceptance tests:
Days between 04/01/02 and 01/01/02 equals 3
Days between 01/05/1998 and 12/10/1977 equals 7506
Days between 01/01/2004 and 01/01/2003 equals 365
Days between 01/01/2002 and 01/01/2000 equals 731
I figure I could convert the dates to doubles and then subtract one
from the other but that wouldnt take leap years into account!!
Any ideas to get me started would be really appreciated!!
thanks
RuSs