Modify the DewPoint and WindChill functions in weather.js to implement these more robust definitions. In particular, both functions should return NaN if called with invalid inputs, and the WindChill function should be updated to handle calm winds. Test your modified functions in your indexes.html page to verify that they behave as desired.

What will be an ideal response?


```
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)
{
if (temp >= 50) {
return NaN;
}
else if (wind <= 3) {
return temp;
}
else {
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
{
if (humidity < 50) {
return NaN;
}
else {
return (temp - (100 - humidity)/2.778);
}
}
```

Computer Science & Information Technology

You might also like to view...

How can you draw a shape from the center, outward?

What will be an ideal response?

Computer Science & Information Technology

The setMaximumRowCount method is used for:

a. Button. b. JComboBox. c. JRadioButton. d. JToggleButton.

Computer Science & Information Technology

A group of bots that are controlled by one individual and can work together in a coordinated fashion is called a _____.

A. ?botnet B. ?botcon C. ?bean bot D. ?chat bot

Computer Science & Information Technology

You use the ________ command-line tool from an administrative command account to enable the computer to join the domain offline

Fill in the blank(s) with correct word

Computer Science & Information Technology