# Can you help me decipher what these two conditions mean in pseudocode?

• November 2nd, 2012, 06:29 PM
divebomb33
Can you help me decipher what these two conditions mean in pseudocode?
CONDITION 1: while ( !(choice == 'Q' || choice == 'q') )
CONDITION 2: while ( choice != 'Q' || choice != 'q' )
• November 2nd, 2012, 06:47 PM
curmudgeon
Re: Can you help me decipher what these two conditions mean in pseudocode?
Condition 2 is always true. Can you see why this is so? One way to figure this out is to use Venn diagrams.
• November 2nd, 2012, 07:00 PM
divebomb33
Re: Can you help me decipher what these two conditions mean in pseudocode?
It looks to me like despite looking a little different they get the same results. I just need some pseudocode of what this is
• November 2nd, 2012, 07:10 PM
curmudgeon
Re: Can you help me decipher what these two conditions mean in pseudocode?
They are most definitely not the same. To make them the same, you'd need to swap either one of the || for &&.

So ( !(choice == 'Q' || choice == 'q') ) is the same as ( choice != 'Q' && choice != 'q' )

and ( !(choice == 'Q' && choice == 'q') ) is the same as ( choice != 'Q' || choice != 'q' )

Again, use Venn diagrams to see that this is so.
• November 2nd, 2012, 07:16 PM
divebomb33
Re: Can you help me decipher what these two conditions mean in pseudocode?
I'm a real novice. I really don't understand the venn diagram link you added.
• November 2nd, 2012, 07:49 PM
curmudgeon
Re: Can you help me decipher what these two conditions mean in pseudocode?
Please click on the image and take a look at this:

Attachment 1512