Which of these lines of pseudocode will correctly test whether the person is over 21 and under 65?%0D%0A%0D%0A(1 point)%0D%0AResponses%0D%0A%0D%0Aif age > 21 AND age < 65%0D%0A%0D%0Aif age > 21 AND age < 65%0D%0A%0D%0Aif age > 21 OR age <65%0D%0A%0D%0Aif age > 21 OR age <65%0D%0A%0D%0Aif age < 21 OR 65%0D%0A%0D%0Aif age < 21 OR 65%0D%0A%0D%0Aif age NOT = 21 OR 65

1 answer

To correctly test whether a person is over 21 and under 65, you need to use the logical AND operator to ensure both conditions are true. The correct lines of pseudocode from the options you provided are:

if age > 21 AND age < 65

This condition checks whether age is greater than 21 and also less than 65, which is what you want.

The other options using OR or incorrect logical comparisons do not accurately represent the condition of being over 21 and under 65.