Assignment 1 - Climate Data Processing
CS 3358

Due: Thursday 09/10/15 at 11:55pm


For this assignment we will be using the actual data for carbon dioxide levels from the National Oceanic and Atmospheric Administration from a station in Hawaii. We will be creating a class that can calculate various averages and differences over time from the raw data. The main purpose of this program is to learn the tools for the course and to use multi-file programs.

We will be using a statistics class (which you will write) to calculate and report on the climate data.

Input:  You will get the file name from the command line of the program. e.g.

linux prompt>./analyze
co2_mm_mlo.txt

Hint: Use Google to find examples of code you are not familiar with (e.g. command line parameters in C++).


Here is an example data file.


Note: The data has a lot of text at the beginning. Read in each word of the file until you reach a line that has "MLO" as the first word. At that point you can start reading the floating point CO2 levels from the data. You may assume that any data file you are given will not have the code "MLO" in the data before the first line of CO2 levels.

Hint: To throw away the text you don't need...

string str;
do {
  inputFile >> str;
      
  cout << ":test" << str << endl; //for testing

while (str != "MLO");

Processing:  You will need to determine the highest, lowest, and average CO2 level in the data. You will also need to calculate the standard deviation of the data. Essentially you are testing the Stats class with this application.

Here is the stats.h header file.

Output: You should provide a main program that reads in the data and provides the appropriate output. Use functions where necessary. Output will go to standard output (the screen). 



Notes:

Turn in:  No hard copy source file turnin.

Submit using: TRACS, the zip file.

Note: We will compile and run these programs using g++ on hercules.cs.txstate.edu. Make sure your programs will compile and run on that computer.