Hello, it's me again, and I'm stuck again. I need to enter the highest and lowest temperatures for seven days, which the program will then store in two columns, with the average of each column stored in the bottom row. I got it working and everything, except that it'll only let me enter one set of numbers and doesn't display the average.
I know there's a thread with about this, but I couldn't fully understand it. I'm not really C++ literate, this is for a required class.
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
using namespace std;
int main()
{
//declare array
int temp[7][2]= {0};
int day = 0;
const int lowtemp = 0;
const int hightemp = 1;
//enter data into array
cout<<endl<<"Enter Day: ";
cin >> day;
cout << "\nEnter low temperature: ";
cin >> temp[day][lowtemp];
cout << "\nEnter high temperature: ";
cin >> temp[day][hightemp];
//test
cout << "\nDay: " << day << " High: " << temp[day][hightemp] << " Low: " << temp[day][lowtemp] <<endl;
system("pause");
return 0;
} //end of main function