Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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)

Data Set A

47
2017-01-01T00:00 32.78
2017-01-01T01:00 18.97
2017-01-01T02:00 -24.92
2017-01-01T03:00 -25.40
2017-01-01T04:00 -26.70
2017-01-01T05:00 -16.22
2017-01-01T06:00 -19.00
2017-01-01T07:00 -21.33
2017-01-01T08:00 14.43
2017-01-01T09:00 -1.88
2017-01-01T10:00 19.56
2017-01-01T11:00 -35.86
2017-01-01T12:00 -26.36
2017-01-01T13:00 -39.60
2017-01-01T14:00 38.18
2017-01-01T15:00 -37.35
2017-01-01T16:00 13.96
2017-01-01T17:00 -4.38
2017-01-01T18:00 27.33
2017-01-01T19:00 30.36
2017-01-01T20:00 -29.83
2017-01-01T21:00 -42.66
2017-01-01T22:00 -37.97
2017-01-01T23:00 7.32
2017-01-02T00:00 26.27
2017-01-02T01:00 -26.56
2017-01-02T02:00 -3.28
2017-01-02T03:00 -40.09
2017-01-02T04:00 -43.17
2017-01-02T05:00 1.26
2017-01-02T06:00 -42.36
2017-01-02T08:00 1.86
2017-01-02T09:00 29.97
2017-01-02T10:00 27.60
2017-01-02T11:00 22.22
2017-01-02T12:00 -35.05
2017-01-02T13:00 -0.71
2017-01-02T14:00 46.52
2017-01-02T15:00 41.23
2017-01-02T16:00 -24.08
2017-01-02T17:00 -3.51
2017-01-02T18:00 -15.11
2017-01-02T19:00 34.19
2017-01-02T20:00 46.32
2017-01-02T21:00 41.89
2017-01-02T22:00 26.34
2017-01-02T23:00 -4.45

Data Set B

47
2017-01-01T00:00 32.9
2017-01-01T01:00 18.97
2017-01-01T02:00 -24.92
2017-01-01T03:00 -25.40
2017-01-01T04:00 -26.70
2017-01-01T05:00 -16.22
2017-01-01T06:00 -19.00
2017-01-01T07:00 -21.33
2017-01-01T09:00 -1.88
2017-01-01T10:00 19.56
2017-01-01T11:00 -35.86
2017-01-01T12:00 -26.36
2017-01-01T13:00 -39.60
2017-01-01T14:00 38.18
2017-01-01T15:00 -37.35
2017-01-01T16:00 13.96
2017-01-01T17:00 -4.38
2017-01-01T18:00 27.33
2017-01-01T19:00 30.36
2017-01-01T20:00 -29.83
2017-01-01T21:00 -42.66
2017-01-01T22:00 -37.97
2017-01-01T23:00 7.32
2017-01-02T00:00 26.27
2017-01-02T01:00 -26.56
2017-01-02T02:00 -3.28
2017-01-02T03:00 -40.09
2017-01-02T04:00 -43.17
2017-01-02T05:00 1.26
2017-01-02T06:00 -42.36
2017-01-02T07:00 31.22
2017-01-02T08:00 1.86
2017-01-02T09:00 29.97
2017-01-02T10:00 27.60
2017-01-02T11:00 22.22
2017-01-02T12:00 -35.05
2017-01-02T13:00 -0.71
2017-01-02T14:00 46.52
2017-01-02T15:00 41.23
2017-01-02T16:00 -24.08
2017-01-02T17:00 -3.51
2017-01-02T18:00 -15.11
2017-01-02T19:00 34.19
2017-01-02T20:00 46.32
2017-01-02T21:00 41.89
2017-01-02T22:00 26.34
2017-01-02T23:00 -4.45

Example of how output should look like

Loaded 47 data points from dataset A
Loaded 47 data points from dataset B
Temperature Reports (dataset A)
-==-==-==-==-==-==-==-==-==-==-==-
Minimum: -43.17
Mean: -1.69
Maximum: 46.52
Date Reports (dataset A)
-==-==-==-==-==-==-==-==-==-==-==-
Earliest: 32.78 (2017-01-01T00:00)
Most recent -4.45 (2017-01-02T23:00)
Inconsistent/Missing Data Reports
-==-==-==-==-==-==-==-==-==-==-==-
Inconsistent Data: 32.78 vs 32.90 (2017-01-01T00:00)
Missing Data: 14.43 (2017-01-01T08:00)

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

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

More Books

Students also viewed these Databases questions

Question

Compare user Guess to list: Python

Answered: 1 week ago

Question

What is cultural awareness?

Answered: 1 week ago

Question

=+5. What do you want them to think?

Answered: 1 week ago

Question

=+What the product does for the end-user.)

Answered: 1 week ago