HW2.17

HW2.17

 import java.util.Scanner;

 public class Solution
 {
     public static void main(String[] args)
     {
         Scanner input = new Scanner(System.in);

         System.out.print("Enter the temperature in Fahrenheit: ");
         double temperature = input.nextDouble();

         System.out.print("Enter the wind speed miles per hour: ");
         double windSpeed = input.nextDouble();

         input.close();

         double windChillIndex = 35.74 + 0.6215 * temperature - 35.75 * Math.pow(windSpeed, 0.16)
             + 0.4275 * temperature * Math.pow(windSpeed, 0.16);
         System.out.println("The wind chill index is " + windChillIndex);
     }
 }
上一篇:java入门学习笔记之2(Java中的字符串操作)


下一篇:java动手动脑和课后实验型问题String类型