1 import java.util.Scanner; 2 3 public class Solution 4 { 5 public static void main(String[] args) 6 { 7 Scanner input = new Scanner(System.in); 8 9 System.out.print("Enter the temperature in Fahrenheit: "); 10 double temperature = input.nextDouble(); 11 12 System.out.print("Enter the wind speed miles per hour: "); 13 double windSpeed = input.nextDouble(); 14 15 input.close(); 16 17 double windChillIndex = 35.74 + 0.6215 * temperature - 35.75 * Math.pow(windSpeed, 0.16) 18 + 0.4275 * temperature * Math.pow(windSpeed, 0.16); 19 System.out.println("The wind chill index is " + windChillIndex); 20 } 21 }
时间: 2024-10-11 17:17:31