Objective: The goal of this assignment is to refresh your memory of 1-dimensional arrays, in preparation for the following lab on multi-dimensional arrays.
Background: To better trace climate change, UTEP is participating in an effort to set up meteorological sensors at various locations. These sensors are run automatically, and it is known that sometimes, when the weather changes drastically (sudden snow or hail), the sensor readings become unreliable. For example, a sensor buried under snow no longer correctly records the outside temperature or the wind velocity.
To be able to correctly process the sensor data, it is important to detect such sensor errors. One way to detect these errors is to compare the readings of two nearby sensors. If the difference between these readings exceeds a certain threshold, then both sensor readings are suspicious (unreliable).
For example, if the temperature threshold is 5 degrees, then readings of 50 and 54 are both reliable, but if the readings are 50 and 60, with a difference of 10 degree, then both readings are unreliable.
Assignment: Let us assume that we have two nearby temperature sensors. Each sensor records the temperature daily. To store the information, we use two one-dimensional arrays:
Assume that the data is stored in two files corresponding to two sensors, each transaction in a separate line.
Example. Assume that we had 3 days of measurement. During these three days, the first sensor recorded the values 50, 51, and 60, and the second sensor recorded the temperatures of 52, 60, and 59. In this case, the first input file is as follows:
50 51 60and the second input file is:
52 60 59Then, the first array will have the values 50, 51, and 60, and the second array will have the values 52, 60, and 59. This means that:
Deliverables: Your TA will instruct you.