Write a program which will read two timestamps from a file and then create an output file that lists the timestamps in order (earliest first), and also displays how many days, hours and minutes are between them. Here are the requirements for the input and output formats:
The program user must enter the name of the input file.
The input file must have one timestamp on each line.
A timestamp consists of a date, followed by a space, followed by a time of day.
All dates will be in the form: month number, slash, date number, slash, year number. However, there are no restrictions on the number of digits for the months, dates or years. If a year only has 2 digits and is >= 20, assume the first two digits are 19. If a year is < 20, assume the first two digits are 20. For example, valid dates are: 7/4/06 (July 4, 2006), 12/25/50 (December 25, 1950), 2/28/1974 (February 28, 1974).
All times of day will be in the form: hours, followed by a colon, followed by minutes, followed by "am", "AM", "pm" or "PM". (We are not using military time for the input of this assignment, only for the output.) For example, valid times are: 3:30pm, 7:05am, 10:45AM.
The output file must be called "timestamps.txt".
Each timestamp in the output file should have exactly two digits for all parts of the dates and the times, except for the year which must have 4 digits. Output the times in military format.
There should be one timestamp per line in the output file, the earlier one first.
The third line of output should state how many days, hours and minutes are between the two timestamps. These should all be non-negative values.
Implementation Details: YOU MAY NOT USE THE SCANNER CLASS FOR THIS ASSIGNMENT!! You must use BufferedReader and/or some form of tokenizers to handle the input. Don't forget that a leap year has 29 days in February. A leap year is one that is evenly divisible by 4, but not by 100 unless also by 400. For example 1500 is not a leap year, but 1600 is, as is 1976. HINT: for each date calculate the number of days since 1/1/0000. Name your program file pg2a.java. In order to test your program, you will need to make up several of your own input files to use.
help??? PLEASE!!!!
The program user must enter the name of the input file.
The input file must have one timestamp on each line.
A timestamp consists of a date, followed by a space, followed by a time of day.
All dates will be in the form: month number, slash, date number, slash, year number. However, there are no restrictions on the number of digits for the months, dates or years. If a year only has 2 digits and is >= 20, assume the first two digits are 19. If a year is < 20, assume the first two digits are 20. For example, valid dates are: 7/4/06 (July 4, 2006), 12/25/50 (December 25, 1950), 2/28/1974 (February 28, 1974).
All times of day will be in the form: hours, followed by a colon, followed by minutes, followed by "am", "AM", "pm" or "PM". (We are not using military time for the input of this assignment, only for the output.) For example, valid times are: 3:30pm, 7:05am, 10:45AM.
The output file must be called "timestamps.txt".
Each timestamp in the output file should have exactly two digits for all parts of the dates and the times, except for the year which must have 4 digits. Output the times in military format.
There should be one timestamp per line in the output file, the earlier one first.
The third line of output should state how many days, hours and minutes are between the two timestamps. These should all be non-negative values.
Implementation Details: YOU MAY NOT USE THE SCANNER CLASS FOR THIS ASSIGNMENT!! You must use BufferedReader and/or some form of tokenizers to handle the input. Don't forget that a leap year has 29 days in February. A leap year is one that is evenly divisible by 4, but not by 100 unless also by 400. For example 1500 is not a leap year, but 1600 is, as is 1976. HINT: for each date calculate the number of days since 1/1/0000. Name your program file pg2a.java. In order to test your program, you will need to make up several of your own input files to use.
help??? PLEASE!!!!





