我寫了下面的程序:迴歸方法,計算錯誤
public double calcElectricityCO2(double avgBill, double avgPrice)
{
return (avgBill/avgPrice)*1.37*12;
}
public static void main(String[ ] args)
{
double avgBill = 338.59;
double avgPrice = 0.12;
double emmision = calcElectricityCO2(avgBill,avgPrice);
System.out.printf("Annual CO2 Emission from Electricity Usage: %1.2f %n",emmision);
}
}
當運行在double emmision = calcElectricityCO2(avgBill,avgPrice);
報告錯誤,我做了什麼錯在那裏?
_錯誤是什麼意思?_ – SLaks