The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
The data will be given to you in a file that is in a comma separated format. We will be using the commas to determine where each piece of the input starts and begins. Samples of the data will be given below. After you read in all the data for a station you will output a summary for that station. There are three types of data that will be included and so there will be three types of summaries. Details on those will be below
Â
Input
Below is a sample for a few of the weather stations. A complete list of the stations will be attached.
STATION,STATION_NAME,ELEVATION,LATITUDE,LONGITUDE,DATE,TPCP,Missing,Consecutive Missing,MNTM,Missing,Consecutive Missing GHCND:US1VACP0007,CULPEPER 6.1 W VA US,177.7,38.4595,-78.1136,20150101,23,0,0,-9999,0,0 GHCND:US1VACP0007,CULPEPER 6.1 W VA US,177.7,38.4595,-78.1136,20150201,722,0,0,-9999,0,0 GHCND:US1VACP0007,CULPEPER 6.1 W VA US,177.7,38.4595,-78.1136,20150301,211,0,0,-9999,0,0 GHCND:US1VACP0007,CULPEPER 6.1 W VA US,177.7,38.4595,-78.1136,20150401,1198,0,0,-9999,0,0 GHCND:US1VACP0007,CULPEPER 6.1 W VA US,177.7,38.4595,-78.1136,20150501,671,0,0,-9999,0,0 GHCND:US1VACP0007,CULPEPER 6.1 W VA US,177.7,38.4595,-78.1136,20150601,647,0,0,-9999,0,0 GHCND:US1VACP0007,CULPEPER 6.1 W VA US,177.7,38.4595,-78.1136,20150701,768,0,0,-9999,0,0 GHCND:US1VACP0007,CULPEPER 6.1 W VA US,177.7,38.4595,-78.1136,20150801,112,0,0,-9999,0,0 GHCND:US1VACP0007,CULPEPER 6.1 W VA US,177.7,38.4595,-78.1136,20150901,1592,0,0,-9999,0,0 GHCND:US1VACP0007,CULPEPER 6.1 W VA US,177.7,38.4595,-78.1136,20151001,20,0,0,-9999,0,0 GHCND:US1VACP0007,CULPEPER 6.1 W VA US,177.7,38.4595,-78.1136,20151101,296,0,0,-9999,0,0 GHCND:US1VACP0007,CULPEPER 6.1 W VA US,177.7,38.4595,-78.1136,20151201,193,0,0,-9999,0,0 GHCND:USC00442009,CORBIN VA US,67.1,38.2022,-77.3747,20150101,799,0,0,12,0,0 GHCND:USC00442009,CORBIN VA US,67.1,38.2022,-77.3747,20150201,563,0,0,-12,0,0 GHCND:USC00442009,CORBIN VA US,67.1,38.2022,-77.3747,20150301,998,0,0,67,0,0 GHCND:USC00442009,CORBIN VA US,67.1,38.2022,-77.3747,20150401,1183,0,0,142,0,0 GHCND:USC00442009,CORBIN VA US,67.1,38.2022,-77.3747,20150501,614,0,0,208,0,0 GHCND:USC00442009,CORBIN VA US,67.1,38.2022,-77.3747,20150601,1585,0,0,237,0,0 GHCND:USC00442009,CORBIN VA US,67.1,38.2022,-77.3747,20150701,965,0,0,248,0,0 GHCND:USC00442009,CORBIN VA US,67.1,38.2022,-77.3747,20150801,249,0,0,238,0,0 GHCND:USC00442009,CORBIN VA US,67.1,38.2022,-77.3747,20150901,1459,0,0,219,0,0 GHCND:USC00442009,CORBIN VA US,67.1,38.2022,-77.3747,20151001,1225,0,0,140,0,0 GHCND:USC00442009,CORBIN VA US,67.1,38.2022,-77.3747,20151101,614,0,0,113,0,0 GHCND:USC00442009,CORBIN VA US,67.1,38.2022,-77.3747,20151201,97,0,0,89,13,7 GHCND:USC00440187,AMELIA 4 SW VA US,105.2,37.3451,-77.9781,20150101,814,0,0,23,4,1 GHCND:USC00440187,AMELIA 4 SW VA US,105.2,37.3451,-77.9781,20150201,941,0,0,-7,3,1 GHCND:USC00440187,AMELIA 4 SW VA US,105.2,37.3451,-77.9781,20150301,1065,0,0,75,5,1 GHCND:USC00440187,AMELIA 4 SW VA US,105.2,37.3451,-77.9781,20150401,1086,0,0,148,1,1 GHCND:USC00440187,AMELIA 4 SW VA US,105.2,37.3451,-77.9781,20150501,329,0,0,206,0,0 GHCND:USC00440187,AMELIA 4 SW VA US,105.2,37.3451,-77.9781,20150601,1880,0,0,244,1,1 GHCND:USC00440187,AMELIA 4 SW VA US,105.2,37.3451,-77.9781,20150701,929,0,0,249,4,2 GHCND:USC00440187,AMELIA 4 SW VA US,105.2,37.3451,-77.9781,20150801,694,0,0,242,3,1
The sample above shows all three of the types of input that will be found in our tests. All the input will start with a header line like the one at the top of the input and it should be ignored. Let me explain each of the columns in the data
The set of data for Culpeper is what I'm calling good data. It has most of the data but it is missing temperature data. That is represented by the -9999. It has all 12 months of data and so we would display this data. See the output below.
The set of data for Corbin is what I'm call all good data. It has all of the data recorded for it, including the temperature and it has all 12 months of data. See the output below.
The set of data for Amelia is what I'm calling bad data because it only has 8 months worth of data. Any set of data that is fewer than 12 months is "bad data". See the output below.
Output
If your program were run with the input above this is what the output should be:
STATION_NAME ELEVATION LATITUDE LONGITUDE TPCP MNTM CULPEPER 6.1 W VA US 177.7 38.4595 -78.1136 2.11713 0 CORBIN VA US 67.1 38.2022 -77.3747 3.396 57.515 AMELIA 4 SW VA US: too few readings
NOTE: All the data in the output is TAB separated. Failure to separate each item on the line with a tab will most likely result in a project that scores very badly because my test code will use the tabs to break apart each line. There is NO tab at the end of the line, just an endl or newline character.
Requirements
Below is a set of requirements you must adhere to:
Procedure
Many times I'm asked how to get started. For this project I'd start by reading in the data and the simply printing it back out. That way you'll know that you are reading in the data correctly. Once you can do that, then I would work on figuring out when the weather station data switched from one station to the next. Once you've got that, then you'll know that you can compute the average for any station that is given.
I would write a function for reading in the data and displaying the data. I would also write a function for converting the precipitation from millimeters to inches and one for converting Celsius to Fahrenheit.
Testing
For this project I have ten tests that use the following pattern: