6.2.1: understand the function of and be able to identify the structural components of programs (constants, variables, initialisation and assignment statements, command sequences, selection, repetition, iteration, data structures, subprograms, parameters, input/output)
Keyword | Definition |
---|---|
assignment | setting the value of a variable at any time in a program e.g. score = 1 |
command sequence | part of an algorithm where multiple instructions are carried out in a particular order |
constant | named value which is set once but can be used multiple times e.g. MAX_SCORE = 10 |
data structure | a named area of memory which stores multiple values (e.g. scores = [1,2,3]) |
initialisation | setting the value of a variable or constant at the start of the program e.g. score = 0 |
input | data which goes in to an algorithm or program e.g. input(...) |
iteration | part of an algorithm that repeats instructions for each value in a data structure e.g. for ... in ... |
output | data which comes out from an algorithm or program e.g. print(...) |
parameter | a value which is passed into a sub program e.g. def square(size): |
repetition | part of an algorithm that is run a set number of times or whilst a condition is met e.g. while lives > 0: |
return value | a value which is passed out from a function |
selection | part of an algorithm where a condition is checked to see which instructions are run next e.g. if ... : |
sub program | a named part of a program which can be called multiple times (either a procedure or a function) e.g. def square(): |
variable | named memory location which stores a value which can be set and used multiple times e.g. score = 0 |