Ok i got my programm working, but the temp are still not coming out right. could someone help me in the right direction.
thanks
Code:
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
const int row=12, col=18;
void windchill (double [][col]);
void print_wind (double[][col]);
void format();
int main()
{
double windchillchart[row][col] = {0};
windchill (windchillchart);
format();
print_wind (windchillchart);
return 0;
}
void windchill (double n[][col])
{
for (int i=0,t = 40;i<row;i++,t-=5 )
for (int j=0, v = 5; j<col;j++, v += 5)
{
n[i][j] = 35.75 + .6215*(t) - 35.75*(pow(v,0.16)) + .4275*(t)*(pow(v,0.16));
}
}
void print_wind (double n[][col])
{
int i,t,j,v;
cout << "\t\t Wind Speed in MPH / Temperture in F \n\n";
cout << " ";
for (i=0, t=40;i<col;i++,t-=5)
cout << setw(4) << t;
cout << "\n\n";
for (i=0,v=5;i<row;i++,v+=5)
{
cout << setw(2) << v;
for (j=0;j<col;j++)
cout << setw(4) << n[i][j];
cout << "\n";
}
}
void format()
{
cout << setiosflags(ios::fixed);
cout << setprecision(0);
}