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.