In cold weather, meteorologists report an index called the windchill factor, that takes into account the wind speed and the temperature. The indexProgramming Projects provides a measure of the chilling effect of wind at a given air temperature. Windchill may be approximated by the formula:
W = 13.12 + 0.6215 *t - 11.37*v 0.16 + 0.3965*t*v 0.016
where
v = wind speed in m/sec
t = temperature in degrees Celsius: t <= 10
W = windchill index (in degrees Celsius)
Write a function that returns the windchill index. Your code should ensure that the restriction on the temperature is not violated. Look up
some weather reports in back issues of a newspaper in your university library and compare the windchill index you calculate with the result
reported in the newspaper.
PROGRAM CODE:
#include<iostream>
#include<cmath>
using namespace std;
double meteorologistReport(double windspeed, double temperature,double windchillindex);
int main()
{
double windspeed,temperature,windchillindex=0;
cout<<"Please enter wind speed(m/sec): ";
cin>>windspeed;
cout<<"Please enter temperature(degrees celsius):";
cin>>temperature;
windchillindex = meteorologistReport(windspeed,temperature
,windchillindex);
cout<<"The windchill index is "<<windchillindex;
return 0;
}
double meteorologistReport(double windspeed, double temperature
,double windchillindex)
{
return windchillindex = (13.12+0.6215*temperature
-11.37*pow(windspeed,0.16)+0.3965*temperature
* pow(windspeed,0.016));
}
OUTPUT OF THE PROGRAM CODE:
Please enter wind speed(m/sec): 100
Please enter temperature(degrees Celsius):25
The wind chill index is 15.5727