# Named Variables and Exponents

• 09-14-2009, 04:55 PM
kathekas
Named Variables and Exponents
Hi

The formula I want to use is:

= 35.74 + 0.6215T - 35.75V (**0.16) + 0.4275TV(**0.16)

In the formula, V is in the wind speed in statute miles per hour, and T is the temperature in degrees Fahrenheit.

In the formula, ** means the following term is an exponent (i.e. 10**(0.5 ) means 10 to the 0.5 power, or the square root of V)

So I am unsure how to create this

windchill = 35.74
+ 0.6215*(temp32 * 1.8 + 32)
- 35.75*windSpeed * 10e0.16
+ 0.4275*(temp32 * 1.8 + 32)* windSpeed * 10e0.16;

But Java complains about not being a statement and want ( or ) or ;

Thanks

Many thanks
• 09-14-2009, 05:10 PM
kathekas
Just found the formula listed as

Windchill = 35.74 + 0.6215T - 35.75(V^0.16) + 0.4275T(V^0.16)
• 09-14-2009, 05:10 PM
Fubarable
Let's see a small near-compilable program showing your code. Thanks!
• 09-14-2009, 05:12 PM
kathekas
Thank you.

Not sure what you mean, but the code I have written is

windchill = 35.74
+ 0.6215*(temp32 * 1.8 + 32)
- 35.75*windSpeed * 10e0.16
+ 0.4275*(temp32 * 1.8 + 32)* windSpeed * 10e0.16;
• 09-14-2009, 06:53 PM
r035198x
Post the full code that you tried to compile.
• 09-14-2009, 06:58 PM
kathekas
Got it working now thanks

if (temp32f <= 50 && windSpeed > 3)
{
windchill =
35.74
+ 0.6215 * temp32f
- 35.75 * Math.pow (windSpeed,0.16)
+ 0.4275 * temp32f * Math.pow (windSpeed,0.16);

} else

{
windchill = 0;
}

Thanks for helping