找不到如何将值增加53和79,
public static void main(String[] args) {
int weight, b;
Scanner sc = new Scanner(System.in);
System.out.print("Enter the Weight : ");
weight = (int) sc.nextDouble();
b = calculateLandingRate(weight);
System.out.println("Total price : " + b);
}
static int calculateLandingRate(int weight) {
int rate = 26;
if (weight<= 25) {
if (weight > 1) {
int totalPrice = 26 * weight;
} else if (weight> 25 && weight < 75) ;`
总价=(重量26kg)+ 53,从重量= 26kg开始,计算应该像该值增加53。
/* int rate = +53; Total price at 26kg = 650 + 53 =703 Total price at 27kg = 703 + 53=756 Total price at 28kg = 756 + 53 =809 Total price at 29kg = 809 + 53 =862 Total price at 30kg = 862 + 53 =915 * * * Total price at 75kg = 3247 + 53 =3300 */ } else if (weight > 75) ;
值增加79整数率= +79;
Total price at 76kg = 3300 + 79 =3379 * * * * Total price at 624 kg = 46592 + 79 =46671
我正在尝试在下面的计算中找到一个Java代码,无法找到如何将值增加53和79,public static void main(String [] args){int weight,b;扫描仪sc =新...