Note that there are some explanatory texts on larger screens.

plurals
  1. POOrder of Operations
    primarykey
    data
    text
    <p>I need help with solving my problem of output code. Sorry for the big chunk of code I need help fixing the output for hI. The two input files can be found (soon to be posted)</p> <p>Please ask if you need what the output looks like or the formula for solving hI ( I can only post two links.).</p> <pre><code>import java.util.Scanner; import java.io.File; import java.io.IOException; public class HeatIndex { public static void main(String[] args) throws IOException { String location = "Key West, Florida"; File fileNameTemp = new File("KeyWestTemp.txt"); File fileNameHumid = new File("KeyWestHumid.txt"); Scanner inFileTemp = new Scanner(fileNameTemp); Scanner inFileHumid = new Scanner(fileNameHumid); String [] month = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "Novermber", "December"}; int length = month.length; double [] temperature = new double[length]; int [] humidity = new int[length]; double [] hI = new double[length]; //INPUT - read in data for temp and humidity from files int n = 0; //index value for arrays while( inFileTemp.hasNextDouble() ) { temperature[n] = inFileTemp.nextDouble(); //System.out.println (temperature[n]); //debug statement - uncomment to see values assignned to temperature n++; } inFileTemp.close(); n = 0; //reset index to 0 while (inFileHumid.hasNextDouble()) { humidity[n] = inFileHumid.nextInt(); //System.out.println (humidity[n]); //debug statement - uncomment to see values assignned to humidity n++; } inFileHumid.close(); //PROCESSING - calculate Heat Index if needed- see lecture notes for details, formula is incomplete double t = 0.0; int h = 0; for(n = 0; n &lt; hI.length; n++) { if( temperature[n] &gt;= 80.0 ) //determine if HI should be calculated, complete the condition based on Lecture notes { t = temperature[n]; h = humidity[n]; hI[n] = -42.379 + 2.04901523*t+ 10.1433312*h- 0.22475541*t*h- 0.000683783*(t*t)- 0.005481717* (h*h)+ 0.000122874*(h*h)*t+ 0.000085282*t*(h*h)- 0.000000199*(t*t)*(h*h); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload