Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Lab 8 - Daily Temperatures Objectives Make use of multiple Functions Make use of

ID: 3687473 • Letter: L

Question

Lab 8 - Daily Temperatures Objectives Make use of multiple Functions Make use of an array to store data (temperatures) Make use of sorting and searching techniques In this lab, you will be examining a set of temperatures collected over a twenty four hour period. Be sure to make use of an array to store these temperatures. data points from a file. You are required to read the data in a function. After reading in the data, you will need to write a function that will find the average of the data set. Make sure to print out the average in main. You will also need to write a function to display the temperatures in the table format shown below You will be required to read in the Difference from the 35 32 4-772 +-222 After you finish the function for printing out the data, you need to write a function that will find the lowest piece of data in the array. You could sort the data, and grab the piece of data in the first position. However, this will result in no credit. You will have to use a linear search to find the lowest piece of data. Once you find it, print out the value you found. In addition to printing out the value, please print out the positon where the value was found. This can be done by having a for loop run over the array, and search for the value using an if statement such as: if (tempArrayil> low) low tempArray[i) You will need to modify the above code segment to handle getting the position of the lowest value. this function, create another function that does the same thing for finding the highest number and its position in the array Once you have written

Explanation / Answer

#include #include // DBL_MIN1,DBL_MAX1 int main() { //INPUT couttemperature; If(inStream.eof()) // read till the end of file break; counttemperatures++; sum+= temperature; if(temperature maximumtemperature) maximumtemperature= temperature } inStream.close() //OUTPUT cout