我写了以下程序:
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);
我在那里做错了什么?