Create a library file named weather.js that contains the definitions of your dew point and wind chill functions. Then, create a Web page named indexes.html that has text boxes where the user can enter the temperature, humidity, and wind speed. The page should load the weather.js library and call the appropriate functions to display the dew point or wind chill at the click of a button.

Use your page to determine the dew point under the following conditions:

temperature = 85 F humidity = 60%
temperature = 95 F humidity = 75%
temperature = 100 F humidity = 90%

Use your page to determine the wind chill under the following conditions:

temperature = 20 F wind speed = 10 mph
temperature = 10 F wind speed = 20 mph
temperature = 0 F wind speed = 30 mph

```
function WindChill(temp, wind)
// Assumes: temp is a temperature in Fahrenheit,
// wind is wind speed in miles per hour
// Returns: the wind chill index (what the current conditions feel like)
{
return 35.74 + 0.6123*temp + (0.4275*temp - 35.75)*Math.pow(wind, 0.16);
}

function DewPoint(temp, humidity)
// Assumes: temp is a temperature in Fahrenheit,
// humidity is the relative humidity (0-100%)
// Returns: the temperature at which water vapor condenses
{
return (temp - (100 - humidity)/2.778);
}

------








Weather Calculator






Temperature: °F


Wind speed: mph


Relative humidty: %










------

temp=85, humidty=60 dew point = 70.60115190784737
temp=95, humidty=75 dew point = 86.0007199424046
temp=100, humidty =0 dew point = 64.00287976961843

temp=20, wind=10 8.670038235710777
temp=10, wind=20 -8.968220556825415
temp=0, wind=30 -25.864926944480686
```

Computer Science & Information Technology

You might also like to view...

The AutoSum and Average functions can NOT be used in a spreadsheet inserted into a PowerPoint presentation

Indicate whether the statement is true or false

Computer Science & Information Technology

A queue is a data structure in which the elements are ____.

A. added to the rear and deleted from the front B. added to and deleted from the rear C. added to and deleted from the front D. added and deleted in the middle

Computer Science & Information Technology