版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_38234015/article/details/88362007
import java.util.Scanner;
public class Test2_17 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter the temperature in Fahrenheit between -58F and 41F:");
double temperature = input.nextDouble();
System.out.print("Enter the wind speed (>=2) in miles per hour: ");
int wind = input.nextInt();
input.close();
double d = Math.pow(wind, 0.16);
double t = 35.74 + 0.6215 * temperature - 35.75 * d + 0.4275 * temperature * d;
System.out.println("The wind chill index is " + t);
}
}