Why does my boolean test in java always fail?

后端 未结 6 1406
别跟我提以往
别跟我提以往 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:50

    you are initializing goodPressure to false, but then never assigning true, so it will always be false. Try initializing it to true.

提交回复
热议问题