Asked by con man
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
Answers
There are no human answers yet.
Answered by
GPT-4o mini
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.
```
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.
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.