我不明白 64 美元是从哪里来的

I don't understand where does $64 comes from

假设一加仑油漆覆盖了大约 350 平方 英尺的墙 space,要求用户输入长度、宽度和高度。这些方法应执行以下操作:

这是我所做的,我没能拿到那 64 美元

public static void main(String[] args){

    double  l,h,w;
    Scanner sc=new Scanner(System.in);
    System.out.print("Enter the height: ");
    h=sc.nextDouble();
    System.out.print("Enter the width: ");
    w=sc.nextDouble();
    System.out.print("Enter the length: ");
    l=sc.nextDouble();
    disGallons(calArea(h, w, l));
    disPrice(price(calGallon(calArea(h, w, l))));
}

public static double calArea(double h,double w, double l){
    double area=2*((w*h)+(l*w)+(l*h));
    return area;
}
public static double calGallon(double area){
    double gallons= area/350;
    return gallons;
}
public static void disGallons(double gallons){
    System.out.println("Gallons needed: "+gallons);
}
public static double price(double gallon){
    final double gallPrice=32;
    return (int)(gallPrice*gallon);
}
public static void disPrice(double price){
    System.out.println("Total Price is: $"+price);
}

这是我的做法。

package io.duffymo;

/**
 * Size the amount of paint needed
 * @link <a href="
 */
public class PaintSizing {

    public static final double PRICE_PER_GALLON_USD = 32.0;
    public static final double SQ_FEET_PER_GALLON = 350.0;

    public static double area(double h, double w, double l) {
        return 2.0*(w + l)*h;
    }

    public static double gallons(double area) {
        return area / SQ_FEET_PER_GALLON;
    }

    public static double price(double gallons) {
        return gallons * PRICE_PER_GALLON_USD;
    }
}

学习 JUnit 永远不会太早:

package io.duffymo;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public class PaintSizingTest {

    @Test
    public void testSizing() {
        // setup
        double l = 15.0;
        double w = 20.0;
        double h = 10.0;
        double expectedArea = 700.0;
        double expectedGallons = 2.0;
        double expectedPrice = 64.0;
        // exercise
        double actualArea = PaintSizing.area(h, w, l);
        double actualGallons = PaintSizing.gallons(actualArea);
        double actualPrice = PaintSizing.price(actualGallons);
        // assert
        Assertions.assertEquals(expectedArea, actualArea, 0.001);
        Assertions.assertEquals(expectedGallons, actualGallons, 0.001);
        Assertions.assertEquals(expectedPrice, actualPrice, 0.001);
    }

}