Question: I want to write a program in java that will read dates from a file and identify which two dates have the fewest number of
I want to write a program in java that will read dates from a file and identify which two dates have the fewest number of days between them and which two dates have the largest number of days between them and output those pairs of dates and the number of days between each pair. For this program, you will be provided with a Date class that you will use to store and process dates with.
the output needs to look like this

Output The output of your program should look like the following sample Enter filename to process: d1.txt The dates from the file are: 11/23/2015 11/24/2015 11/25/2015 11/26/2015 02/23/2016 11/28/2015 11/29/2015 11/30/2015 11/30/1955 12/02/2015 Of the 10 dates processed: Closest (1): 11/23/2015 and 11/24/2015 Furthest (22000): 02/23/2016 and 11/30/1955 Make sure to include the following items in the format seen above . The program should output a list of the dates themselves, one per line Output the number of dates that were read from the file . Then output the dates that are "closest" to each other, including the number of days between the two dates Finally, output the dates that are the "furthest" from each other, including the number of days between the two date:s
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
