Algorithm Representation
Symbol Usage
Terminal – Begin / EndThere should only be
one
Begin and
one
End in thealgorithm. Subprograms have their own Begin and End.Process – initialisation (setting start-up values); assignment(setting values) or calculationInput / OutputDecision: selection or repetitionThis symbol is used to show any condition that is tested.There are two types of selection: binary and multi-way.Binary selection can be expanded to multi-way throughnested IF statements. However, CASE statements are amore efficient way of coding multiple paths.There are two types of repetition: guarded / pre-test or unguarded/ post-test. Guarded loops test the condition before executing the statements within the loop. Unguardedloops test the condition after executing the statements withinthe loop once.WHILE loops
must
be primed – the variable(s) tested in thecondition
must
be set prior to the beginning of the loop.Fixed iteration loops are a form of guarded loops which runa set number of times (although this can be determined bythe value of variables). They are useful because theincrementation of the condition value is automatic.The variables that are tested in the condition must beupdated in the loop. If the value doesn't change the loopwill continue forming an infinite loop.Subprogram – a subprogram is a section of code that can bereused any number of times during the program. Variablescan be passed into subprograms in the form of arguments / parameters to allow for minor changes in the running of thesubprogram.Subprograms are procedures or functions and can be
created by the programmer or preexisting.
Begin / EndProcessInput / OutputDecisionSubprogram
Add a Comment