Results 1 to 6 of 6
  1. #1
    kathekas is offline Member
    Join Date
    Sep 2009
    Posts
    4
    Rep Power
    0

    Default 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 ;

    Please can you help me?

    Thanks

    Many thanks

  2. #2
    kathekas is offline Member
    Join Date
    Sep 2009
    Posts
    4
    Rep Power
    0

    Default

    Just found the formula listed as

    Windchill = 35.74 + 0.6215T - 35.75(V^0.16) + 0.4275T(V^0.16)

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  4. #4
    kathekas is offline Member
    Join Date
    Sep 2009
    Posts
    4
    Rep Power
    0

    Default

    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;

  5. #5
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Post the full code that you tried to compile.

  6. #6
    kathekas is offline Member
    Join Date
    Sep 2009
    Posts
    4
    Rep Power
    0

    Default

    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

Similar Threads

  1. Could not locate named parameter
    By nc_newie in forum Enterprise JavaBeans (EJB)
    Replies: 3
    Last Post: 06-06-2009, 12:46 AM
  2. (Help) Fraction Summation and Exponents
    By SapphireSpark in forum New To Java
    Replies: 19
    Last Post: 10-09-2008, 04:01 AM
  3. Pls HeLp Me (Design a class named Fan)
    By faw in forum Advanced Java
    Replies: 5
    Last Post: 04-21-2008, 07:25 PM
  4. MappingException: Named query not known :
    By abhibh_1 in forum Web Frameworks
    Replies: 0
    Last Post: 08-14-2007, 12:59 PM
  5. named pipes
    By samson in forum Networking
    Replies: 1
    Last Post: 04-04-2007, 06:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •