Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please change this code so that it has the functions from above: getData, averageHight, averageLow, indexHighTemp, indexLowTemp. #include #include using namespace std; int main() {
Please change this code so that it has the functions from above: getData, averageHight, averageLow, indexHighTemp, indexLowTemp.
#include#include using namespace std; int main() { int INT_MIN, INT_MAX; int temp[2][12]; int high = INT_MIN; int low = INT_MAX; int i; cout > temp[0][i]; cout > temp[1][i]; int sum_high = 0; int sum_low = 0; for (i = 0; i high) high = temp[0][i]; if (temp[1][i] Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and the highest and lowest temperatures for the year. Your program must consist of the following functions . Function getData: This function reads and stores data in the two-dimensional array. Function averageHigh: This function calculates and returns the average high temperature for the year. .Function averageLow: This function calculates and returns the average low temperature for the yealr. . Function indexHigh Temp: This function returns the index of the highest high temperature in the array. .Function indexLowTemp: This function returns the index of the lowest low temperature in the array. These functions must all have the appropriate parameters. Sample run Enter high temperature for each month 89 95 76 66 68 87 85 83 76 65 63 60 Enter low temperature for each month 78 80 70 60 60 77 75 70 68 62 60 55 Average high temperature: 76 Average low temperature: 67 Highest temperature: 95 Lowest temperature: 55
Step 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