nerdexam
CompTIA

FC0-U61 · Question #546

Given the pseudocode below: Which of the following inputs will result in a TRUE for pizza and party?

The correct answer is D. Red = TRUE -. Based on the correct answer and implied pseudocode logic, an input where the variable 'Red' is TRUE will result in both 'pizza' and 'party' being TRUE.

Software Development

Question

Given the pseudocode below:

Which of the following inputs will result in a TRUE for pizza and party?

Options

  • ARed = TRUE -
  • BRed = FALSE -
  • CRed = FALSE -
  • DRed = TRUE -

How the community answered

(32 responses)
  • A
    9% (3)
  • B
    13% (4)
  • C
    3% (1)
  • D
    75% (24)

Why each option

Based on the correct answer and implied pseudocode logic, an input where the variable 'Red' is TRUE will result in both 'pizza' and 'party' being TRUE.

ARed = TRUE -

While 'Red = TRUE -' would lead to the correct outcome, this option is textually identical to the correct answer D, implying a redundant choice or missing context in the question itself.

BRed = FALSE -

If 'Red' is FALSE, the implied pseudocode logic would typically lead to 'pizza' and 'party' being FALSE, not TRUE.

CRed = FALSE -

Similar to choice B, if 'Red' is FALSE, the pseudocode's conditional statements would logically result in 'pizza' and 'party' being FALSE.

DRed = TRUE -Correct

The provided correct answer indicates that setting the variable 'Red' to TRUE triggers the logic within the pseudocode that subsequently sets both 'pizza' and 'party' to TRUE.

Concept tested: Conditional logic in pseudocode

Topics

#pseudocode#logical operators#programming logic

Community Discussion

No community discussion yet for this question.

Full FC0-U61 Practice