我非常新,我会尽力说出最好的话(英语不是我的第一语言。)我希望我的主题名称不会混淆,直截了当。
public static double dogTotalFee(double totalFee)//calculate total fee (without tax)
{
double cost = 0.0;
double weight = 0.0;
int days = 0;
cost = 0.7;
return totalFee = cost * weight * days;
}//end dogTotalFee
public static double dogTax(double totalTax)//calculate tax
{double taxRate = 0.0;
double totalFee = 0.0;
return totalTax = totalFee * taxRate;
}//end dogTax
public static double dogTotalPrice(double totalPrice)
{
double totalFee = 0.0;
double totalTax = 0.0;
return totalPrice = totalFee + totalTax;
}//end dogTotalPrice
这些值显示为零,计算结果不合理。
totalFee = dogTotalFee(totalFee);
totalTax = dogTax(totalTax);
totalPrice = dogTotalPrice(totalPrice);
我主要在方法中进行数学计算,但我似乎无法获得要传输的值。谢谢