- #1
bengaltiger14
- 138
- 0
Homework Statement
Write a program to determine the age of an object given the creation date and todays date. The program must contain 6 user input statements (asking for year, month and date of creation, and year,month, todays date) and display the age of the object in days.
I have already written functions to determine how many days are in a month and to determine if a year is a leapyear. The days in month function has the leap year function inside of it in cases of february
I have the 6 input statement written and I am now stuggling with the code.
I have this after the input statements:
if month1 > month2 || ((month1==month2) && (date1>date2))
years = (year2 - year1) - 1
Where do I go from here and am I even doing this correctly?
Month 1 is the creation month, month 2 is todays month, date 1 is creation date and date2 is todays date.