package homeWork;
import java.util.Scanner;
public class T0822 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
//prompt the user to enter the fahrenheit and wind chill index
System.out.print("Enter the tempreture in fahrenheit between -58 °F and 41 °F:");
double tempreture = input.nextDouble();
System.out.print("Enter the wind speed miles per hour(must be greater than or equal to 2:");
double windChill = input.nextDouble();
if(tempreture >= (-58) && tempreture <= 41 && windChill >= 2) {
//T是风寒温度
double T = 35.74 + 0.6215 * Math.pow(windChill, 0.16) + 0.4275 * Math.pow(tempreture,0.16);
System.out.println("The wind chill index is " + T);
}
else
System.out.println("Can't run");
input.close();
}
}
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/70007877/viewspace-2794979/ ,如需转载,请注明出处,否则将追究法律责任。