Write a program that uses a two-dimensional array to store thehighrst and lowrst temperatures for each month of the year. Theprogram should output the average high, average low, and thehighest and lowest temperatures for the year. Your program mustconsist of the following functions:a. Function getData: This function reads and stores data inthe two-dimensional array.b. Function averageHigh: This function calculates and returnsthe average high temperature for the year.c. Function averageLow: This function calculates and returnsthe average low temperature for the year.d. Function indexHighTemp: This function returns the index ofthe highest temperature in the array.e. Function indexLowTemp: This function returns the index ofthe lowest low temperature in the array.(These functions must all have the appropiate parameters.)****In C++**** and it must read from a data file and includefunction void display and output this exact output seen in pictureattached!!! HELP
This is a sample of int main solution out professor gave us!!e problem of brownsville weather – Protected View – Saved e Search Isaiah Solis eferences Mailings Review View Help iruses. Unless you need to edit, it’s safer to stay in Protected View ECUTE Enable Editing 70 78 Sample Output of the Program: The following is the Brownsville’s year long high and low temperatures Month High Low January 53 February 74 56 March 60 April 84 May June July August September October November December 88 91 79 Average high temperature: 82 Average low temperature: 66 Highest temperature: 93 Lowest temperature: 53 Drocust the problem of brownsville weather Protected View – Saved Search Isaiah Solis eferences Mailings Review View Help wiruses. Unless you need to edit, it’s safer to stay in Protected View Enable Editing Skeleton Solution of the problem: const int NO OF_MONTHS = 12; void getData(int twoDim[][2], int rows); int averageHigh(int twoDim[][2], int rows); int averageLow(int twoDim[][2], int rows); int indexHighTemp(int twoDim[][2], int rows); int indexLowTemp (int twoDim[][2], int rows); void display(int twoDim[][2], int); ifstream inFile(“weather.txt”); ofstream outFile(“Wearther.out”); t”); int main() int hiLowArray[NO_OF_MONTHS][2]; int indexHigh; int indexLow; getData(hi LowArray, NO_OF_MONTHS); displayChi LowArray, NO_OF_MONTHS); cout << “nAverage high temperature: << averageHigh(hiLowArray, NO_OF_MONTHS) << endl; out File << “nAverage high temperature: Focus OR 9 w U Search Isaiah Solis – Skeleton of the problem of brownevile weather Protected View. Seved ayout References Mailings Review View Help can contain viruses. Unless you need to edit it’s safer to stay in Protected View Share Enable Editing « averageHigh(hiLowArray, NO_OF_MONTHS) << endl; cout << “nAverage low temperature: ” << averageLow(hilowArray, NO OF MONTHS) << endl; outFile << “nAverage low temperature: << averagelow(hiLowArray, NO OF MONTHS) << endl; indexHigh = indexHigh Temp(hilowArray, NO_OF MONTHS); cout << “nHighest temperature: ” << hilowArray[indexHigh][0] << endl; outFile << “nHighest temperature: ” << hilowArray[indexHigh][@] << endl; indexlow – indexLow Temp (hilowArray, NO OF MONTHS); cout << “nLowest temperature: ” << hiLowArray[indexLow][1] << endl; outFile << “nLowest temperature: ” << hilowArray[indexLow][1] << endl; return 0; Sample Output of the Program: brous- Show transcribed image text e problem of brownsville weather – Protected View – Saved e Search Isaiah Solis eferences Mailings Review View Help iruses. Unless you need to edit, it’s safer to stay in Protected View ECUTE Enable Editing 70 78 Sample Output of the Program: The following is the Brownsville’s year long high and low temperatures Month High Low January 53 February 74 56 March 60 April 84 May June July August September October November December 88 91 79 Average high temperature: 82 Average low temperature: 66 Highest temperature: 93 Lowest temperature: 53 Drocust
the problem of brownsville weather Protected View – Saved Search Isaiah Solis eferences Mailings Review View Help wiruses. Unless you need to edit, it’s safer to stay in Protected View Enable Editing Skeleton Solution of the problem: const int NO OF_MONTHS = 12; void getData(int twoDim[][2], int rows); int averageHigh(int twoDim[][2], int rows); int averageLow(int twoDim[][2], int rows); int indexHighTemp(int twoDim[][2], int rows); int indexLowTemp (int twoDim[][2], int rows); void display(int twoDim[][2], int); ifstream inFile(“weather.txt”); ofstream outFile(“Wearther.out”); t”); int main() int hiLowArray[NO_OF_MONTHS][2]; int indexHigh; int indexLow; getData(hi LowArray, NO_OF_MONTHS); displayChi LowArray, NO_OF_MONTHS); cout
Expert Answer
Answer to Write a program that uses a two-dimensional array to store the highrst and lowrst temperatures for each month of the yea…