Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a C++ program which reads data from a file and processes it as listed in the Requirements. Download the file Data file for assignment
Write a C++ program which reads data from a file and processes it as listed in the Requirements. Download the file Data file for assignment 9 from Blackboard to your account in the lab and save it with the filename temperature.dat. This file contains a week of hourly temperature data with one line for each of the 7 days, where each line contains 24 integers (separated by spaces) which are the temperatures in Fahrenheit for each hour of the day. This is a text file and you can open it and view the data
Write a C++ program which reads data from a file and processes it as listed in the Requirements Download the file "Data file for assignment 9" from Blackboard to your account in the lab and save it with the filename temperature.dat. This file contains a week of hourly temperature data witlh one line for each of the 7 days, where each line contains 24 integers (separated by spaces) which are the temperatures in Fahrenheit for each hour of the day. This is a text file and you can open it and view the data Requirements: . Name your source file program9.cp Make an array with the definition double celcius [71241 Read in the data from the file temperature.dat, convert each value to celcius, and save the celcius temperatures in this array Write a function with the following prototype void show_warmer (double temperature [] [24], int days, double cutoff); This function takes a parameter temperature which is a two-dimensional array of some num- ber of days, of 24 hours each. The second parameter days is the number of days for which to access the array temperature. The third parameter cutoff is a value which elements of temperature are compared to in looking for values which are larger. This function needs to print out the values which it finds in the format of the example below (e.g. the output line "At day 2, hour 19, the temperature was 22.78 C."). . Prompt the user to enter a value, and then call the function show warmer () using the value entered by the user for the cutoff parameter. (The prompts and layout must look like the example below Write a function with the following prototype double find_average(double temperature [] [24], int days); This function takes a parameter temperature which is a two-dimensional array of some num- ber of days, of 24 hours each. The second parameter days is the number of days for which to access the array temperature. This function needs to find and return the average of all the values in temperature. It must not print anything on the screenStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started