Which of the following is not a requirement or good practice in structured design of programs?

Difficulty: Easy

Correct Answer: Use many GOTO statements within modules

Explanation:


Introduction / Context:
Structured design promotes readable, maintainable programs through clear control structures and modular decomposition. Unrestricted jumps using GOTO contradict these principles and increase complexity.


Given Data / Assumptions:

  • Goal is maintainable code with predictable control flow.
  • Modules should have single responsibilities and minimal coupling.
  • Control constructs such as sequence, selection, and iteration are preferred.


Concept / Approach:
Structured programming avoids arbitrary jumps. Instead, developers use if else, loops, and case constructs to express logic. This reduces cyclomatic complexity and eases testing.


Step-by-Step Solution:

1) List the practices associated with structured design. 2) Identify the practice that conflicts with those principles. 3) Conclude that heavy use of GOTO is not a requirement and is discouraged.


Verification / Alternative check:
Check authoritative guidelines that emphasize hierarchical modules, top to bottom flow, and limited coupling. None endorse liberal GOTO usage.


Why Other Options Are Wrong:

Hierarchy of modules is foundational to structured design. Top to bottom control within a module supports clarity. Module independence with defined interfaces reduces coupling. High cohesion is a classic quality goal.


Common Pitfalls:
Believing that occasional structured exits are equivalent to arbitrary jumps is a misunderstanding.


Final Answer:
Use many GOTO statements within modules.

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion