Advertisement
Guest User

Untitled

a guest
Jul 27th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class If
  4. {
  5.   public static void main (String[] args){
  6.       double v, t, wci;
  7.       Scanner scan = new Scanner(System.in);
  8.      
  9.       System.out.println("Please enter the wind speed in miles per hour ");
  10.       v = scan.nextDouble();
  11.      
  12.       System.out.println("Please enter the temperature in Fahrenheit");
  13.       t = scan.nextDouble();
  14.      
  15.       wci = 0.0;
  16.      
  17.       if (0 <= v)
  18.           if (v <= 4)
  19.           wci = t;
  20.       else
  21.           if (v >= 45)
  22.               wci = (1.6 * t) - 55;
  23.           else
  24.               wci = 91.4 + (91.4 - t) * (0.0203 * v - 0.304 * (v*Math.sqrt(0.5)) - 0.474);
  25.          
  26.     System.out.println("The wci is: " + wci);
  27.          
  28.  }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement