15,961,519 members
1.00/5 (1 vote)
See more:
I don't understand what I'm needing to do here need help on this for my science final, if I don't do this I fail...

HTML
```<html>

h2{
text-align:center
}
<h2>Rainfall Predictor </h2>

<title> Rainfall  </title>
var AirTemp
var DewPoint
var WindVelocity
var AirPressure
var Trend
var Ratio
var HourlyRain
var TrendPick
var DayTotal
var StormPeriod
// prediction engine
function GetTrend(){
TrendPick = document.forms.f.Trend.selectedIndex;
return

}

function compute()
{
// calculate DewPoint/AirTemp ratio
Ratio = document.forms.f.DewPoint.value/document.forms.f.AirTemp.value;
Ratio = parseFloat(Ratio).toFixed(2);
StormPeriod= 62.5/(document.forms.f.WindVelocity.value*1.852); //precipatation hours s time storm to travel 62.5 km
// assumption is made that typical storm cell or band is 100km or 62.5 miles wide
if (Ratio < 0.86) //0.86 is lower limit of dewpoint/air temperature curves
{
Ratio = 0.86;
}
// students create code here to limit the Ration from being more than 1.0
if (TrendPick==1){
// calculate hourly rainfall steady barometer

HourlyRain=();   // students fill in the function between the ()
HourlyRain=parseFloat(HourlyRain).toFixed(2);
DayTotal = HourlyRain*StormPeriod;
document.forms.f.DayRate.value = DayTotal;
}
else if (TrendPick==2){
// calculate hourly rainfall rising barometer
HourlyRain = (2.5725*Math.pow(Ratio,2)-(4.433*Ratio) +1.9106);
HourlyRain =parseFloat(HourlyRain).toFixed(2);
DayTotal = HourlyRain*StormPeriod;
document.forms.f.DayRate.value = DayTotal;
}
else if (TrendPick==3){
// calculate hourly rainfall falling barometer
HourlyRain = (1.797*Math.pow(Ratio,20.356));
HourlyRain = parseFloat(HourlyRain).toFixed(2);
DayTotal = HourlyRain*StormPeriod;
document.forms.f.DayRate.value = DayTotal;
}
else{
}
//document.write ('DewPoint/Temp ='+ Ratio);
//document.write("  ");
//document.write(' Hourly rainfall = '+ HourlyRain);
//document.write ('TrendPick= '+TrendPick);

document.forms.f.HourRate.value = 'Hourly rate(in./hr.) = '+HourlyRain;
document.forms.f.DayRate.value = 'Day total (in.) = ' + DayTotal;
}
<div align="center">
<table><tbody><tr><td> Enter Air Temperature Degrees C
</td></tr><tr><td> Enter Dew Point Degrees C
</td></tr><tr><td>Enter Wind Velocity Knots &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</td></tr><tr><td>Enter Air Pressure Millibars &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</td></tr><tr><td>Choose Air Pressure Trend
Choose
Rising
Falling
</td></tr><tr></tr><tr><td>
</td></tr></tbody></table>
</div>```

What I have tried:

this is what he's telling us to focus on
HTML
```// students create code here to limit the Ration from being more than 1.0
if (TrendPick==1){
// calculate hourly rainfall steady barometer

HourlyRain=();   // students fill in the function between the ()```
Posted
Updated 26-Oct-20 23:20pm
v2

## Solution 1

You need to add the <script> tags around the Javascript code. See JavaScript Where To[^]