In flowcharting, which type of instruction belongs inside the diamond-shaped decision symbol?
-
AS = B - C
-
BIS A<10
-
CPRINT A
-
DDATA X,4Z
-
ENone of the above
Answer
Correct Answer: IS A<10
Explanation
Introduction / Context:Flowcharts use standardized symbols to represent program logic. The diamond denotes a decision point—a Boolean test whose outcome directs control flow along different branches. Identifying which statements belong in a decision symbol is fundamental to algorithm design and documentation.
Given Data / Assumptions:
- The diamond symbol expects a yes/no or true/false condition.
- Assignments and I/O are typically represented by rectangles/parallelograms.
- We are choosing among expressions representing a test, an assignment, an output, or data declaration.
Concept / Approach:
A decision node asks a question such as 'A < 10?' and branches accordingly. 'IS A<10' expresses a condition. Assignment (S = B - C) changes state; printing (PRINT A) is output; data declarations are neither tests nor runtime decisions.
Step-by-Step Solution:
Identify which option yields a Boolean outcome.'IS A<10' evaluates to true/false and dictates branching.Exclude assignment, output, and data statements that do not produce a branch decision.Select the decision expression for the diamond.Verification / Alternative check:
Flowchart conventions from software engineering texts consistently place relational tests in diamonds and actions in rectangles/parallelograms.
Why Other Options Are Wrong:
- S = B - C: process step, not a decision.
- PRINT A: output, not a decision.
- DATA X,4Z: declaration, not control flow.
Common Pitfalls:
- Embedding computations inside the decision that should be performed in prior process steps.
Final Answer:
IS A<10.