What are the three basic building blocks of a structured program?
Sequences, Operators, and Operands.
Sequences, Selectctions, Repetitions.
while(), for(), and do/while() loops.
Functions, Statements, Variables.
A diamond-shoped simple on a flow chart represents what?
A decision point.
An input/output operation.
A key point in the algorithm.
An entry/exit point.
How many exit points does a structured program or program component have?
None.
Exactly one.
Two - one for a normal exit and one for an abnormal exit.
How ever many necessary to handle all of the exit conditions.
Which of the following is NOT true of arrows on a flowchart.
Program flow always proceeds from the tail of an arrow to the head of an arrow.
They may converge if multiple paths lead to the same element.
They may diverge if multiple paths can be followed from an element.
A task block is attached to exactly one arrow head and one arrow tail.
A program element characterized by a set of tasks that are performed in the same order every time that program element is executed describes what?
A sequence.
A selection.
A repetition.
A block.
A program element characterized by a set of tasks that may be performed multiple times under the control of some test condition describes what?
A sequence.
A selection.
A repetition.
A block.
A program element characterized by a set of tasks which may or may not be executed under the control of some test condition describes what?
A sequence.
A selection.
A repetition.
A block.
Which of the following statements is true?
The use of repetitions structures in a program is seldom used in practice - selections structures are far more useful.
A repetition structure is really just a special case of a selection structure.
A decision point on a flow chart must be labeled to indicate whether it is for a selection structure or a repetition structure.
Structured programming reflects the way instructions are carried out on an actual processor.
How many arrow tails can leave a decision point?
Exactly one (one entry, one exit rule)
One or two.
Exactly two.
As many as necessary, but the conditions under which each is followed must be a clear consequence of the test condition used.
Flow charts often have many exit circles on them. Why doesn't this violate the one entry, one exit rule?
If the flow chart is for a lower level in the program structure it is not subject to the one exit rule.
If the flow chart is for a top level block, then the program never actually exits and so the number of exit circles is irrelevant.
Conceptually they are all the same exit point because the next instruction to get executed will be the same regardless of which exit circle caused the exit.
It does violate it - such a flow chart does not represent a structured program.