Skip to content

Instantly share code, notes, and snippets.

@stuliston
Created May 26, 2014 04:07
Show Gist options
  • Save stuliston/89afc072cda0a81f0224 to your computer and use it in GitHub Desktop.
Save stuliston/89afc072cda0a81f0224 to your computer and use it in GitHub Desktop.
Date Test

The Challenge

Create an application that can read in pairs of dates in the following format -

DD MM YYYY, DD MM YYYY

Validate the input data, and compute the difference between the two dates in days.

Output of the application should be of the form -

DD MM YYYY, DD MM YYYY, difference

Where the first date is the earliest, the second date is the latest and the difference is the number of days.

Input can be from a file, or from standard input, as the developer chooses.

Provide test data to exercise the application.

Constraints:

The application may not make use of the libraries for date manipulation (for example Date, Calendar classes).

The application can limit calculation on an input range of dates from 1900 to 2010

Deliverables:

The source files, the test data and any test code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment