• Post Reply Bookmark Topic Watch Topic
  • New Topic

i cant understand why its false  RSS feed

 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it should say if success=true then System.out.println("whole chair:chair + chairx+chairy = Chair"); and after else the chair is false or something that should say that it is wrong

 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that is the escape condition. You are in a larger "while success is true" loop. When the conditions are met (i.e. the sum is correct), you set success to "false" and break out of the loop.

I think it is a poorly chosen variable name, but it is what it is.
 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fred rosenberger wrote:it's false because numchair+numchairx+numchairy) does not equal numallchair.

Since you didn't show us how numallchair gets set, that's about all the help we can give you.
i understand it thanks.All will be replaying until this numchair+numchairx+numchairy be equal with numallchair and when it does this in the if {}else{} it will go to else
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i was replying to your the original version of your post, which you were probably editing/revising at the same time.
 
Knute Snortum
Sheriff
Posts: 4288
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a classic example of a poorly named variable being an error. Watch how things get clearer with a better variable name:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!