public static boolean isDrinkOrNot(int flag)
{
boolean judge = false;
if(flag==1){judge = true;}
return judge;
}
public static double drinkPrice(double num, boolean drink)
{
double totalDrinkPrice;
if(drink){totalDrinkPrice = 20*num;}
else{totalDrinkPrice = (5*num)*0.95;}
return totalDrinkPrice;
}
//最好能解释一下这段代码,初学,表示有些看不懂。。。非常感谢各位大神啦~
Crafon
慕粉1474736290
Crafon
相关分类