I found a few things you might want to look at:
for (WS = Min_Wind; WS >=Max_Wind; WS += 10)
you want to do this while WS is lager than Max_Wind? think that WS <= Max_Wind is better.
for (temp = AirT; AirT < 50; temp -= 5)
you are testing the AirT (AirT < 50;) you probarly want to check temp(temp < 50;)instead, since that is the variable you are changing
zyruz
Junior Poster in Training
60 posts since Jun 2005
Reputation Points: 10
Solved Threads: 5
if (AirT > 50)
{
cout << "Temperature is not valid, please enter another temperature\n";
}
cout << "Enter the Air Temperature:\n";
cin >> AirT;
Might want to move the if to afer you have asked for AirT
If you want WS to change in the last for loop you need to do somthing like this:
for (int WS = Min_Wind; WS < Max_Wind; WS +=10)
{
for (temp = AirT; temp < 50; temp -= 5)
{
cout << WindChill(temp,WS);
}
}
your last loop had a little error:
for (temp = AirT; AirT < 50; temp -= 5)
{
cout << setw(Width) << int (WindChill(AirT,WS));
}
you use the function WindChild with AirT instead of temp.
zyruz
Junior Poster in Training
60 posts since Jun 2005
Reputation Points: 10
Solved Threads: 5