/* This is a driver program to test the WindChill() function.
 *************************************************************/

#include <iostream.h>      	                          // cin, cout, <<, >>

double WindChill(double tempFahr, double windSpeed); // function prototype

int main()
{
   double temp,   // Fahrenheit temperature
          wind;   // wind speed (mph)

   cout << "Enter Fahrenheit temperature and wind speed (mph): ";
   cin >> temp >> wind;
   cout << "Wind chill index is " << WindChill(temp, wind) << endl;

   return 0;
}

/* WindChill computes wind chill.
 *
 * Receive: tempFahr, a Fahrenheit temperature
 *          windSpeed, in miles per hour
 *
 * Return:  the wind chill
 *************************************************************************/

#include <cmath>      	     // sqrt

double WindChill(double tempFahr, double windSpeed)  // function definition
{
   double v_part = 
             0.474677 - 0.020425 * windSpeed + 0.303107 * sqrt(windSpeed);
   return 91.4 - v_part * (91.4 - tempFahr);
}


