Ask Computer Engineering Expert

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

  1. STATION - this is the official station identification. We won't be displaying this.
  2. STATION_NAME - this is the name for the station. In our summary, we will be displaying this.
  3. ELEVATION - this is the elevation for the station. We will be displaying this.
  4. LATITUDE - this is the latitude of the station. We will be displaying this.
  5. LONGITUDE - this is the longitude of the station. We will be displaying this.
  6. DATE - this is the date for the reading. We won't be displaying this.
  7. TPCP - this is the total precipitation recorded by the station in tenths of a millimeter. We will be displaying this but it will be converted to inches.
  8. Missing - this is a number representing how many days in the month there was missing data. We will not be displaying this data.
  9. Consecutive - this is a number of consecutive days when the precipitation was not recorded. We will not be displaying this data.
  10. MNTM - this is the mean temperature recorded by the station. -9999 indicates it wasn't recorded. If it was recorded it is in Celsius.  It is recorded in tenths of a degree.  So for example 12 is really 1.2 degrees Celsius. We will be displaying this in Fahrenheit. If a station shows -9999 then we will use 0 for that report.
  11. Missing - this is a number representing how many days in the month there was missing data. We will not be displaying this data.
  12. Consecutive - this is a number of consecutive days when the temperature was not recorded. We will not be displaying this 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:

  1. You must prototype the functionvoid weatherSummary( string inputfile, string outputfile );in a file nameProject2.hPlease pay attention to the spelling and capitalization.
  2. You may not store the data in an array, vector, etc. as you read it in. Simply process it as you go.
  3. You may not use the STL or other code libraries outside of the ones we've used in examples, e.g. string, iostream, iomanip, etc.
  4. The use of global variables is prohibited. Pass your variables into your functions.
  5. You must write at least two additional functions. That's a total of at least 3 functions.
  6. Follow the style guidelines posted in Canvas.
  7. This is an individual assignment, you may not get any unauthorized assistance.

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:

  1. All Good Data 1 set
  2. Good data no temp data 1 set
  3. Not enough data 1 set
  4. More than 1 set of all good data
  5. More than 1 set of data missing temp
  6. More than 1 set of not enough data
  7. Random amounts of all 3 sets of data
  8. Random amounts of all 3 sets of data
  9. Random amounts of all 3 sets of data
  10. Random amounts of all 3 sets of data

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91677472
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As