In structured design, a solution organized as a hierarchy of modules where each module (subroutine) has a single entry and a single exit is commonly known as what design approach?
-
AHierarchy structure
-
BTop-down design
-
CTuple
-
DTurnaround
-
ENone of the above
Answer
Correct Answer: Top-down design
Explanation
Introduction / Context:Structured design advocates decomposing a complex problem into smaller modules with clear interfaces. A classic rule is that modules should have a single entry and a single exit to make control flow predictable and testable. The design style that emphasizes hierarchical decomposition from the most abstract to the most concrete is top-down design.
Given Data / Assumptions:
- Modules are arranged hierarchically.
- Each module follows the single-entry/single-exit principle.
- The intent is clarity, maintainability, and testability.
Concept / Approach:Top-down design starts with a high-level specification, then iteratively refines it into lower-level modules. The single-entry/single-exit rule complements control structures (sequence, selection, repetition) and helps avoid spaghetti code. The result is a tree of modules with well-defined responsibilities.
Step-by-Step Solution:1) Recognize hierarchical decomposition as a hallmark of top-down design.2) Note the single-entry/single-exit guidance for structured programming.3) Connect these to the named approach: top-down design.4) Exclude unrelated terms like tuple (data concept) and turnaround (operations term).
Verification / Alternative check:Structured programming literature links top-down decomposition with reduced complexity and easier verification, especially when modules adhere to single-entry/single-exit.
Why Other Options Are Wrong:Hierarchy structure: vague label rather than a standard design approach name.Tuple: a data structure concept, not a design method.Turnaround: refers to processing or operational cycles, not design.None of the above: incorrect because top-down design matches.
Common Pitfalls:Over-decomposition into too many tiny modules; violating single-entry/single-exit with multiple returns and gotos, harming testability.
Final Answer:Top-down design