```
#include <iostream>
#include <iomanip>
#include <cstdlib>
using namespace std;
const int numberOfRows = 2;
const int numberOfColumns = 12;
void getData(int matrix[][numberOfColumns], int noOfRows);
void avgHigh(int matrix[][numberOfColumns], int noOfRows);
void avgLow(int matrix[][numberOfColumns], int noOfRows);
void indexHighTemp(int matrix[][numberOfColumns], int noOfRows);
void indexLowTemp(int matrix[][numberOfColumns], int noOfRows);
void pause ( );
int main ()
{
int temps[numberOfRows][numberOfColumns];
getData(temps, numberOfRows);
avgHigh(temps, numberOfRows);
cout << endl;
avgLow(temps, numberOfRows);
cout << endl;
indexHighTemp(temps, numberOfRows);
cout << endl;
indexLowTemp(temps, numberOfRows);
pause ( );
return 0;
}
void getData(int matrix[][12], int rowSize)
{
cout<<"Enter high temperature for each month"<<endl; ;
for (int rows=0; rows<1; rows++)
for (int cols =0; cols<12; cols++)
{
cin>>matrix[0][cols];
cout<<matrix[0][cols];
cout<<endl;
}
cout<<"Enter low temperatures for each month"<<endl;
for (int rows=0; rows<1; rows++)
for (int cols =0; cols<12; cols++)
{
cin>>matrix[1][cols];
cout<<matrix[1][cols];
cout<<endl;
}
}
void avgHigh(int matrix[0][12], int rowSize)
{
int rows, cols;
int sum;
int average;
for (rows = 0; rows < 1; rows++)
{
sum = 0;
for (cols = 0; cols < 12; cols++)
sum = sum + matrix[rows][cols];
average=sum/12;
cout << "Average high temperature: " << average<<endl;
}
}
void avgLow(int matrix[1][12], int rowSize)
{
int rows, cols;
int sum;
int average;
for (rows = 0; rows < 1; rows++)
{
sum = 0;
for (cols = 0; cols < 12; cols++)
sum = sum + matrix[1][cols];
average=sum/12;
cout << "Average low temperature: " << average<<endl;
}
}
void indexHighTemp(int matrix[][12], int rowSize)
{
int rows;
int cols;
int highest;
for (rows = 0; rows < rowSize; rows++)
{
highest = matrix[rows][12];
for (cols = 1; cols < 12; cols++)
if (highest < matrix[rows][cols])
highest = matrix[rows][cols];
cout << "The highest temperature is: " << highest<< endl;
}
}
void indexLowTemp(int matrix[][12], int rowSize)
{
int rows;
int cols;
int lowest;
for (rows = 0; rows < rowSize; rows++)
{
lowest = matrix[rows][12];
for (cols = 1; cols < 12; cols++)
if (lowest > matrix[rows][cols])
lowest = matrix[rows][cols];
cout << "The lowest temperature is: " << lowest<< endl;
}
}
void pause()
{
cout << endl;
cout << "Enter a character to quit --> "; //
char dummy;
cin >> dummy; // Wait
}
```