My problem is to make a program that stores a High temperature and a Low temperature within a two dimensional array and then displays the Average. I can get the numbers to be stored(I think, but the average doesn't work at all it seems to display the last number entered in the 7th temperature. Could someone help me out and show me what I did wrong?
#include <iostream>
#include <cmath>
using namespace std;
//******function prototypes********
void getTempsAvg(int xTemps[7][2]);
int main ()
{
//display array
int temps[7][2] = {0};
getTempsAvg(temps);
system("pause");
return 0;
}
//*****Functions*****
void getTempsAvg(int xTemps[7][2])
{
int temperatures = 0;
const int DAYS = 7;
const int TEMPS = 2;
for (int days = 0; days < 7; days ++)
{
cout << "Enter High Temp for day "
<< days + 1 << ": ";
cin >> xTemps[DAYS][TEMPS];
cout << "Enter Low Temp for day "
<< days + 1 << ": ";
cin >> xTemps[DAYS][TEMPS];
} //end for
xTemps[DAYS][TEMPS] / 7;
cout << "Average temperatures " << xTemps[DAYS][TEMPS] << endl;
}