Program: Data Manipulation

Description

Custom-built programs are often used to manipulate a dataset by reformatting or performing additional calculations on data that might not be easily done using standard applications. For example, a researcher may wish to modify a structured dataset by performing a set of operations on each line of the data file.

SPECIFICATIONS

This program is to read through an input file line by line. Each line is to be processed by determining the minimum, maximum, and current temperature at each location. Once this is determined, the three variables for each location should be written to an output file before proceeding to the next line. As is often found in datasets, values may be missing. If this is the case, your program should simply use the numerical values that are available.

NOTE: Students with correct solutions to Mini-Project-1 are encouraged to use these functions in this program.

INPUT

Your program will read in waterTemps.txt which contains the current and previous water temperatures measured at various locations along the East Coast. This will be the only input file tested; you may assume your program only has to read in the number of lines contained in this file (1 header + 16 data lines).

OUTPUT

Your program will produce an output file, named processedWaterTemps.txt, which contains the minimum, maximum, and current temperatures for each location. The spacing of the output file is up to you as long as each data point is provided in the correct order. The format of the new file should be:

Location minimum maximum current

Kiptopeke-VA 36 78 80.6

. . .

NOTE: The water temperature values are float/double type, your solution to Mini-Project 1 may have to be modified to correctly read these values.

DELIVERABLES

Submit your code using the instructions given on the course projects page. The input file is given to you. Your program must process the input file and produce the entire correct output file to receive credit. Name your program by last name, first initial, and project-1. Thus, for Jonathan Leidig, the file name would be Leidig-J-Project-1.cpp. REMEMBER: simply outputting the expected output file lines without processing the actual input file is a direct violation of the VT Honor Code.

50% of the project grade will be assigned for the hardcopy based on the project style rubric. The remaining 50% will be assigned for the Curator submission based on the program correctness.

GETTING STARTED

int main()

{

// input file = waterTemps.txt

//output file = processedWaterTemps.txt

//double current, min, max

//Loop

//Read a line from the input file

//Call four functions to determine the location, min, max, and current values for this input line

//Write the results to output (location, min, max, current)

}