Write a 2-demensional array to store the highest and lowesttemperature for each
ID: 3610160 • Letter: W
Question
Write a 2-demensional array to store the highest and lowesttemperature for each month of the year. The program should output: - average high - average low - the highest temp of the year - the lowest temp of the year Program must consist the following functions: 1. function function getData - reads and stores data in2-demensional array 2. function averageHigh - calculates and returns the averagehigh temperature of the year 3. function averageLow - calculates and returns theaverage low temperature of the year 4. function indexHighTemp - returns the index of highest hightemperature in array 5. function indexLowTemp - returns the index ofhighest low temperature in array Use 2D Array [12,2] Month Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec High 43 45 51 57 64 70 75 75 69 59 49 45 low 34 34 38 42 49 54 58 57 52 46 39 36 Write a 2-demensional array to store the highest and lowesttemperature for each month of the year. The program should output: - average high - average low - the highest temp of the year - the lowest temp of the year Program must consist the following functions: 1. function function getData - reads and stores data in2-demensional array 2. function averageHigh - calculates and returns the averagehigh temperature of the year 3. function averageLow - calculates and returns theaverage low temperature of the year 4. function indexHighTemp - returns the index of highest hightemperature in array 5. function indexLowTemp - returns the index ofhighest low temperature in array Use 2D Array [12,2] Month Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec High 43 45 51 57 64 70 75 75 69 59 49 45 low 34 34 38 42 49 54 58 57 52 46 39 36Explanation / Answer
please rate - thanks #include using namespace std; void getData(int[][2],string[]); double averageHigh(int[][2]); double averageLow(int[][2]); int indexHighTemp(int[][2]); int indexLowTemp(int[][2]); int main() {stringmonth[12]={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"}; int i,mat[12][2],inHigh,inLow; double ahigh,alow; getData(mat,month); ahigh=averageHigh(mat); alow=averageLow(mat); inHigh=indexHighTemp(mat); inLow=indexLowTemp(mat); coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.