java语言程序设计基础篇(原书第八版)编程练习题2.17答案!急啊~!明天就要用

如题所述

public class Exercise2_17 {
// Main method
public static void main(String[] args) {
java.util.Scanner input = new java.util.Scanner(System.in);
// Enter the temperature in Fahrenheit
System.out.print("Enter the temperature in Fahrenheit " +
"(must be between -58癋 and 41癋): ");
double fahrenheit = input.nextDouble();
// Enter the wind speed miles per hour
System.out.print("Enter the wind speed miles per hour " +
"(must be greater than or equal to 2) : ");
double speed = input.nextDouble();

// Compute wind chill index
double windChillIndex = 35.74 + 0.6215 * fahrenheit - 35.75 *
Math.pow(speed, 0.16) + 0.4275 * fahrenheit *
Math.pow(speed, 0.16);

// Display the result
System.out.println("The wind chill index is " + windChillIndex);
}
}
温馨提示:内容为网友见解,仅供参考
第1个回答  2012-11-12
马上追问

亲,可以了没有啊

相似回答