双变量加,然后减去12%

时间:2016-08-28 18:43:38

标签: java

所以我正在使用双变量。我只需要帮助弄清楚如何将它们加在一起,然后从答案中拿出12%。

public class Hello {
//c
    public static void main(String[ ] args) {
        first_number = 10.5;
        second_number = 20.8;
        answer = first_number + second_number;

        System.out.println("Additional Total="+ answer-12%);
    }
}

2 个答案:

答案 0 :(得分:2)

获得总数的88%

System.out.println("Additional Total = " + answer * .88);

答案 1 :(得分:1)

将总和乘以(1 - 0.12)