Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with this task in Java language please Thank you! Two weather stations periodically take temperature data samples. Each data point consists of a

Need help with this task in Java language please Thank you!

Two weather stations periodically take temperature data samples. Each data point consists of a date-time stamp as an ISO 8601 formatted string (example: 2016-11-03T12:01) and a temperature (example: 76.2). Data from the two weather stations is stored in two data files with the following format: the first line is an integer indicating the total number of data samples in the file. Each subsequent line is the date-time stamp and a temperature value separated by a space. An example:

5 2017-01-01T02:00 -24.92 2017-01-01T04:00 -26.70 2017-01-01T00:00 32.78 2017-01-01T03:00 -25.40 2017-01-01T01:00 18.97 

The data is not necessarily in any order in the data files.

Your program will read in data from two files (we'll refer to them as data set A and data set B) whose path/names are provided as command line arguments and generates the following reports:

For the data in data set A, report the minimum, maximum and mean temperatures.

Temperature Reports (dataset A) -==-==-==-==-==-==-==-==-==-==-==- Minimum: -43.170000 Mean: -1.686596 Maximum: 46.520000 

For the data in data set A, report the earliest available (by date) data point and the most recent data point. Your report should look something like the following.

Date Reports (dataset A) -==-==-==-==-==-==-==-==-==-==-==- Earliest: 32.780000 (2017-01-01T00:00) Most recent -4.450000 (2017-01-02T23:00) 

Inconsistent/Missing Data Reports. The final report will compare the two data sets and report any inconsistencies or missing data. In particular:

Report any data point in data set A that is missing in data set B (a data point is missing if the date/time stamp record is in A but is not in B).

Report any data point in data set A whose corresponding data point (by date) in set B has a temperature that is off by more than 0.001 degrees.

Your output should look something like the following.

Inconsistent/Missing Data Reports -==-==-==-==-==-==-==-==-==-==-==- Inconsistent Data: 32.78 vs 32.90 (2017-01-01T00:00) Missing Data: 14.43 (2017-01-01T08:00) 

An test case example has been provided in this repository. The actual data may consist of millions of data points. You will NOT be able to solve this problem with a brute-force approach (comparing all possible pairs of data). You will need to use efficient searching and sorting techniques.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions