Home > front end >  if/else statement stays in the first condition
if/else statement stays in the first condition

Time:01-19

No matter the weight I enter, the output is always $3.50; however, it does not make any mistake on java. Can someone tell me what's wrong with it? Thank you. enter image description here

CodePudding user response:

It's because the first condition weight > 0 is always fulfiled.

  •  Tags:  
  • Related