Why does my boolean test in java always fail?

后端 未结 6 1400
别跟我提以往
别跟我提以往 2021-01-21 21:59

I am trying to make a boolean test so that if one of the tire pressures is below 35 or over 45 the system outputs \"bad inflation\".

In my class I must use a boolean, wh

6条回答
  •  深忆病人
    2021-01-21 22:27

    Look at the last if statement. You are doing assignment not comparison.

    BTW. Your program will always return false once you do that... look at your logic. Where do you set goodPressure to true?

提交回复
热议问题