September 14th, 2012, 08:57 PM
Homework help setting up something
The code isn't correct (I know that much) but here's some info:
I need to pass the temperatures of 80 degrees to 105 degrees through something that lets me know what the heat index is at 40, 60 and 80% humidity.
(Heat Index Temperature = C1 + C2 * Temperate + C3 * humidity + C4 * temperature * humidity + C5 * temperature * temperature
+ C6 * humidity * humidity + C7 * temperature * temperature * humidity + C8 * temperature * humidity * humidity + C9 * temperature * temperature * humidity * humidity)
Here's the basic's of the equation.
And here's the variables:
public static final int MIN_TEMPERATURE = 80; //degrees F
public static final int MAX_TEMPERATURE = 105; //degrees
public static final int LOW_HUMIDITY = 40;
public static final int MED_HUMIDITY = 60;
public static final int HIGH_HUMIDITY = 80;
public static final double C1 = -42.379;
public static final double C2 = 2.04901523;
public static final double C3 = 10.14333127;
public static final double C4 = -0.22475541;
public static final double C5 = -6.83783E10-3;
public static final double C6 = -5.481717E10-2;
public static final double C7 = 1.22874E-3;
public static final double C8 = 8.5282E-4;
public static final double C9 = -1.99E-6;
i've been told I need to use a loop in the main method to call this method with the specified temperature (loop control variable) and
humidity (3 calls in the loop, one for each humidity value).
How should I start going about this?
September 15th, 2012, 07:47 AM
Where are the methods defined that you are talking about?
The code you posted just defines a bunch of variables and assigns them initial values.
Can you post the code with the methods?
September 15th, 2012, 07:55 AM
That's the thing. I don't know where to begin yet so I haven't set up any methods.
Originally Posted by NormR
September 15th, 2012, 08:07 AM
Start by reading the tutorial on how to define a method:
Then write the code in steps. Define a skeleton for the method,
code a call to the method and compile that.
Fix the errors and recompile. continue until the errors are fixed.
When the skeleton compiles ok, then work on putting the logic in the method to do the job it is supposed todo.
Last edited by NormR; September 15th, 2012 at 08:10 AM.