9618 · 11.3
Structured Programming flashcards
Revision flashcards for Cambridge 9618 Structured Programming (syllabus 11.3). Flip, recall, then mark a real past-paper question.
Card
What is Structured Programming?
A programming paradigm aimed at improving code clarity and maintainability by using only three control structures: sequence, selection, and iteration.
Card
What is Sequence in structured programming?
The execution of statements one after another in the order they are written in the code.
Card
What is Selection in structured programming?
A control structure that allows a choice to be made between different paths of execution, based on a condition. Examples: IF...THEN...ELSE, CASE...OF...OTHERWISE.
Card
What is Iteration in structured programming?
A control structure that allows a block of code to be executed repeatedly. Examples: FOR...NEXT, WHILE...ENDWHILE, REPEAT...UNTIL.
Card
What is Top-Down Design?
A problem-solving technique where a complex problem is broken down into smaller, more manageable sub-problems. Also known as stepwise refinement.
Card
What is the purpose of a Hierarchy Chart?
To visually represent the structure of a program, showing how the main problem is broken down into sub-problems (modules/procedures/functions).
Card
Why is the `GOTO` statement avoided in structured programming?
It creates unconditional jumps in the code, leading to 'spaghetti code' that is difficult to read, debug, and maintain. Structured control flow makes logic easier to follow.
Card
What is 'maintainability' in the context of programming?
The ease with which a program can be modified to correct faults, improve performance, or adapt to a changed environment. Structured programming greatly improves maintainability.
Card
What is modularity?
The concept of breaking a program down into independent, interchangeable modules (like procedures or functions). It's a direct result of top-down design.
Card
Is a `CASE` statement a form of iteration?
No, this is a common misconception. A `CASE` statement is a form of selection, allowing the program to choose one path from several options, similar to a nested `IF...THEN...ELSEIF`.
Card
What is Stepwise Refinement?
Another term for Top-Down Design. It's the process of progressively breaking down a problem into smaller steps or 'refinements' until each step is simple enough to be coded.