I am writing a program where you type in the highs and lows for the week and it averages them and tells you the highest and lowest temperature. I would like it to ask the high for Sunday then the low for Sunday, then the high for Monday and so on. I can't seem to get the days in order and the average, highest, and lowest function won't work for me. Any help on what I should do would be greatly appreciated :D
#include <iostream>
#include <iomanip>
using namespace std;
void main(void)
{
const int MAX = 7;
float highs[MAX];
float lows[MAX];
int count = 0;
int counts = 0;
int x, i;
do {
cout << "Enter the high temperatures: ";
cin >> highs[count];
count++;
cout << endl;
} while ( ( count < MAX) && ( highs[count-1] != 0) );
if ( highs[count-1] == 0)
{
count--;
}
do {
cout << "Enter the low temperatures ";
cin >> lows[counts];
counts++;
cout << endl;
} while ( ( counts < MAX) && ( lows[counts-1] != 0) );
if ( lows[counts-1] == 0)
{
counts--;
}
float sum = 0.0;
for (int i=0; i < MAX; i++)
{
sum += lows[i];
}
cout << "The average temperatures is: " << (highs[counts] + lows[counts])/14 << "\n";
cout << "Minimum value: " << lows[counts-1] << '\n';
cout << "Maximum value: " << highs[counts+1] << '\n';
system("pause");
}