Exactly. That's why your do-while loop never exited with the logical or: there was always at least one true expression, so the entire statement evaluated to true. It could never be false. Now examine...
Type: Posts; User: helloworld922
Exactly. That's why your do-while loop never exited with the logical or: there was always at least one true expression, so the entire statement evaluated to true. It could never be false. Now examine...
&& is logical and. It means what you think it does: Is this true, and is that true? || is logical or. Note that its use in programming (and math) is a little different from its use in English: Is...
Try building a logic table for your do-while conditional.
If sentinelChar = 'Y', is it true or false? What if sentinelChar = 'a', or sentinelChar = 'n'?
What is it doing that's wrong? Is there a compile/runtime error? What message is it giving you?