Hi Everyone could anybody help me on why my wind chill factor does not equal -20
During winter when it is very cold, typically, everyone would like to know the windchill factor, especially, before going out. Meteorologists use the following formula to compute the windchill factor, W:
W = 35.74 + 0.6215 * T-35.75*V0.16 + 0.4275 * T *V0.16,
where V is the wind speed in miles per hour and T is the temperature in degrees Fahrenheit.
#include <iostream>
#include <cmath>
#include <iomanip>
usingnamespace std;
// These are all the declarations used to calculate the windchill as well as what is used to store the
// users input
int windchill(double wind, double temp);
double w;
int windchill(double v, double t);
double wind, temp;
int main()
{
double wind, temp;
cout << "Enter the wind speed in miles per hour: ";
cin >> wind;
cout << "Enter the temperature in fahrenheit: ";
cin >> temp;
cout << "Current temperature: " << temp << "F" << endl;
cout << "Windchill factor " << setprecision(4) << fixed << windchill(wind, temp) << endl;
system("pause");
}
// This is the part of the program that calculates the windchill factor and the output is shown
//above to the user.
int windchill(double v, double t)
{
double w;
w = 33 - (((10 * sqrt(v) - v + 10.5)*(33 - t)) / 23.1);
return w;
return 0;
system("pause");
}