nerdexam
CompTIA

FC0-U61 · Question #593

Given the following code: Which of the following case choices would be executed?

The correct answer is B. Ten pears would be moved from inventory to the fruit display. Based on the context of conditional execution, this question asks which specific output would result from a given (implied) code snippet.

Software Development

Question

Given the following code:

Which of the following case choices would be executed?

Options

  • ATen apples would be moved from inventory to the fruit display.
  • BTen pears would be moved from inventory to the fruit display.
  • CTen peaches would be moved from inventory to the fruit display.
  • DTen kiwi would be moved from inventory to the fruit display.

How the community answered

(23 responses)
  • A
    9% (2)
  • B
    87% (20)
  • D
    4% (1)

Why each option

Based on the context of conditional execution, this question asks which specific output would result from a given (implied) code snippet.

ATen apples would be moved from inventory to the fruit display.

This choice would only be executed if the code's condition specifically matched 'apple', which is not the case based on the correct answer.

BTen pears would be moved from inventory to the fruit display.Correct

Assuming the provided code includes a conditional structure, such as a switch statement or if-else if block, the condition that specifically matches 'pear' must evaluate to true, causing the corresponding code block to execute and produce the output 'Ten pears would be moved from inventory to the fruit display.'

CTen peaches would be moved from inventory to the fruit display.

This choice would only be executed if the code's condition specifically matched 'peach', which is not the case based on the correct answer.

DTen kiwi would be moved from inventory to the fruit display.

This choice would only be executed if the code's condition specifically matched 'kiwi', which is not the case based on the correct answer.

Concept tested: Conditional programming logic

Topics

#control flow#conditional statements#programming logic

Community Discussion

No community discussion yet for this question.

Full FC0-U61 Practice