A clever and simple method of preparing to sort dates into ascending (increasing) or descending (decreasing) order is to convert a date in the form month/day/year into an integer number with the formula date = year × 10000 + month × 100 + day. For example, using this formula, the date 12/6/1988 converts to the integer 19881206, and the date 2/28/2010 converts to the integer 20100228. Sorting the resulting integer numbers puts dates into the correct order automatically. Using this formula, write a function named convertdays() that accepts a month, day, and year; converts the passed data into a single date integer; and returns the integer to the calling function.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here