錯誤我「明明」剛開始學習編程,我似乎無法弄清楚如何才能做,如果這錯誤擺脫。錯誤發生在第二行到最後一行之前:[System.out.print(+ windChill);]Math.pow在Java中
這裏(寫在下面)是Java生成的'可能的提示'列表那我收到的錯誤:
**')' expected method pow in class java.lang.Math cannot be applied to given types required: double,double found: double method pow in class java.lang.Math cannot be applied to given types required: double,double found: double operator + cannot be applied to double,pow incompatible types required: doub...**
任何提示或澄清將是非常讚賞。請參閱下面的代碼。先謝謝你。
巴蒂爾
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO code application logic here
Scanner input = new Scanner(System.in);
System.out.print("Enter a temperature between -58 and 41 degrees Fahrenheit and press ENTER");
double temperature = input.nextDouble();
System.out.print("Enter a wind speed that is 2 miles per hour or faster and press ENTER");
double windSpeed = input.nextDouble();
double windChill = (((35.41 + temperature - Math.pow(windSpeed * 16) + Math.pow(temperature * 16)));
System.out.print(+windChill);
}
}
+1用於解決這兩個問題。 – st0le 2010-09-27 03:58:26
也從我+1。在發現第一個錯誤後,我不應該停止閱讀。 :) – 2010-09-27 04:00:10
謝謝@ st0le和@Bill :) – 2010-09-27 04:07:07