- What is the purpose of a structure chart?
- A structure chart decomposes a problem into sub-tasks, and each sub-task is a module. It shows the module relationships, the hierarchy of which module calls which, and the parameters passed between the modules. It also shows whether each module is a function or a procedure.
- What does the selection diamond mean on a structure chart?
- A diamond on the lines to modules shows selection: the module calls one of the modules below it, and the choice is decided when the program runs. The word 'either' in a description is the clue. A module that calls both modules is not drawn with a diamond.
- What does a curved arrow that starts and ends at the same module mean on a structure chart?
- A curved arrow that begins and ends at a module shows iteration. The module repeatedly calls the modules below it. A full answer names those modules in the correct sequence in which they are called.
- How do you write a pseudocode header for a module in a structure chart?
- A module that returns a value is a function, written with RETURNS. A module that returns nothing is a procedure. A parameter that the module assigns a new value to, for the caller to use, is passed with BYREF, so the caller sees the change.
- How is a state-transition diagram drawn?
- A state-transition diagram documents an algorithm. It shows the states a system can be in and the events that move it from one state to another. Each transition is a labelled arrow, and the arrow into the first state is labelled Start.
- What is a common mistake when describing iteration in a structure chart?
- A vague answer such as a loop will have Module A call the other Modules is too vague. A full answer shows that Module A repeatedly calls the modules in the correct sequence, and names each one.