title: How to use while and loop?
body: <p>For this assignment my teacher asked me to use while loop and the program should calculate the windchill based on the wind speed and temperature that entered by the user. Then my program will calculate and print 15 equivalent windchill temperatures for wind speeds incrementally by 1 mile per hour beginning with the entered wind speed. </p>
  
  <p><strong>This is the expected output on the terminal when the user enters 20 as temperature and 5 for wind speed.</strong></p>
  
  <blockquote>
    <p>Temp is 20.0 Wind is 4.0 Windchill = 14.21540906987616<br>
    Temp is 20.0 Wind is 5.0 Windchill = 12.981228533315587<br>
    Temp is 20.0 Wind is 6.0 Windchill = 11.939602066643864<br>
    Temp is 20.0 Wind is 7.0 Windchill = 11.034900625509994<br>
    Temp is 20.0 Wind is 8.0 Windchill = 10.232972275268978<br>
    Temp is 20.0 Wind is 9.0 Windchill = 9.51125906241483<br>
    Temp is 20.0 Wind is 10.0 Windchill = 8.854038235710775<br>
    Temp is 20.0 Wind is 11.0 Windchill = 8.249889600830752<br>
    Temp is 20.0 Wind is 12.0 Windchill = 7.690242381822841<br>
    Temp is 20.0 Wind is 13.0 Windchill = 7.168491016780937<br>
    Temp is 20.0 Wind is 14.0 Windchill = 6.679431097848575<br>
    Temp is 20.0 Wind is 15.0 Windchill = 6.218885266083873<br>
    Temp is 20.0 Wind is 16.0 Windchill = 5.783446866468811<br>
    Temp is 20.0 Wind is 17.0 Windchill = 5.370299352288381<br>
    Temp is 20.0 Wind is 18.0 Windchill = 4.977085976370098  </p>
  </blockquote>
  
  <p>I tried so many times, but I keep getting endless loops and the windchill stopped calculating. It just provides the same answer. I can only made the wind speed keep increasing by 1.
  I would like to ask how can I let the program only loop for 15 times based on the number that the user entered, and how can the wind chill start calculating in different answer.</p>
  
  <p>This is what I am working on, (T = temp, V = wind speed, W = windchill)</p>
  
  <pre><code>public class windchill3
  {
      public static void main(String[] args) 
      {
          double W;
          double T;
          double V;
  
          T = Double.valueOf(args[0]);
          V = Double.valueOf(args[1]);
          W = 0.6215 * T - 35.75 * Math.pow(V, 0.16) + 0.4275 * T * Math.pow(V, 0.16) + 35.74;
  
          if (V &lt; 0) {
              System.out.println("Error");
          }
  
          while(V&gt;0) {
              T = Double.valueOf(args[0]);
              V = Double.valueOf(args[1]);
              W = 0.6215 * T - 35.75 * Math.pow(V, 0.16) + 0.4275 * T * Math.pow(V, 0.16) + 35.74;
  
              V++;
  
              System.out.println("The &gt; Temperature is : " + T + " | The windspeed is: " + V + " | The windchill is: " + W);
          }
      }
  }
  </code></pre>