0

我收到以下代码字符串的错误:

    int status = readInt("Status: ");
    double income = readDouble("Please enter your taxable income: ");
    println("You owe: ");

    if ((status = 0) && (income <= 9075))

它给了我一个“二元运算符 && 错误的操作数类型”错误,它突出显示&& (income <= 9075))了问题所在。我敢肯定,找出问题所在很容易,但我做不到;有任何想法吗?

4

2 回答 2

1

status = 0 应该是 status == 0

于 2014-02-27T15:22:25.937 回答
1

您需要有两个 ==,否则输出将不是条件。

 if ((status == 0) && (income <= 9075))
于 2014-02-27T15:23:13.903 回答