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' )

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.

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

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.

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.

1 Attachment(s)

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