package nameyu;import java.util.Scanner;public class Test { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner input=new Scanner(System.in); System.out.print("Enter the temperature in Fahrenheit between -58°F and 41°F:"); double Fahrenheit=input.nextDouble(); System.out.print("Enter the wind speed (x>=2) in miles per hour:"); double speed=input.nextDouble(); if(speed>=2&&Fahrenheit>-58&Fahrenheit<41){ double twc=35.74+0.6215*Fahrenheit-35.75*Math.pow(speed, 0.16)+0.4275*Fahrenheit*Math.pow(speed, 0.16); System.out.println(twc); } else System.out.println("error"); } }
|