Question: here is data Due: Friday March 2, 11:59pm on Bblearn Turn in: A copy of the program (.cpp file) and a sample output showing the

 here is data Due: Friday March 2, 11:59pm on Bblearn Turn

here is data

in: A copy of the program (.cpp file) and a sample output

Due: Friday March 2, 11:59pm on Bblearn Turn in: A copy of the program (.cpp file) and a sample output showing the results of running each of the 4 functions For this lab you will be reading in and analyzing a set of data. The data file is in the file called weather.txt. It is provided to you and you need to copy it to wormulon. You should begin by opening the file with nano or another text editor and examining the format note that it contains the weather (highest and lowest temperature of each day) for Moscow, ID for January 1 to 31,2016 to write a program to read in the data and do the following calculations using 4 For this lab you need functions (pass array and its size to the functions) Report the highest recorded temperature Report the lowest recorded temperature Report the average daily high temperature Report the average daily low temperature To read in a data file you need to open the file using the fstream library (#include ). Then you need to create an input file stream object and connect it to the weather file: int x; ifstream infile; //create an ifstream object infile.open ("weather.txt" l/open the file, if the weather.txt is located under the same directory with your program, otherwise, path to the file needs to be specified Then you can read from the file using infile infile >> x; //read in a single integer from the file Note that the >> symbols are used just as with cin, but now the data is coming from a file rather than the keyboard infile.close () //close the file after reading The weather.txt file contains 3 columns of data (if the date is treated as 3 columns). So, you may want to create 3 separate arrays one for each column Note that the code to read in the data may look something like: for(int i = 0; 1 > array1i]; infile array2[il infile >>array3i]; Make sure the data is stored into arrays correctly, and then work on building the functions

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!