Programming Practice
1. A weather forecasting service analysis is logging the temperature over a day to provide some
basic statistical analysis. Temperatures are logged in a file named "temperature.txt". Write
a C++ program to read the temperature values from file "temperature.txt", put it in a one-
dimensional array and write different functions to find the following statistical measures:
a) sum(), to find sum of all temperatures over the day
b) average(), to find mean of all temperatures over the day
c) min(), to find the minimum temperature over the day
d) max(), to find the minimum temperature over the day
e) bsort(), to sort temperatures in ascending order using bubble sort method
f) reverse(), to reverse the unsorted temperature array
g) bsearch(), to find the index of a certain temperature value in the array
h) display(), to display elements of an array using the range for loop