// prompts for windspeed(m/hour) and temperature (F) and computes the wind // chill calculator as follows // windchill = 0.0817 (3.71 sqrt(windspeed) + 5.81 -.25) * // (temp - 91.4) + 91.4 // // Sean McCulloch // 10/27/98 #include #include using namespace std; double windchill(double, double); // computes the wind-chill factor int main() { // declaring and entering the temperature and wind speed double temp, windspeed; cout << "Enter the temperature (in farenheit): "; cin >> temp; cout << "enter the wind speed (in miles per hour): "; cin >> windspeed; cout << "The wind chill value is: " << windchill(temp, windspeed) << endl; } // computes the wind-chill factor on the basis of // temp - temperature and // ws - wind speed double windchill(double temp, double ws){ double result = 0.0817 * (3.71*sqrt(ws)+5.81-.25*sqrt(ws)) * (temp-91.4) +91.4; return(result); }