Save
...
computer science
programming
GCSE (9-1): Computer Science: AQA: Structured Programming
Save
Share
Learn
Content
Leaderboard
Learn
Created by
lucy dock
Visit profile
Cards (13)
Iteration
A piece of code that
repeats
, a
loop.
One of the four main programming constructs, we use
WHILE
or
FOR
to code it
View source
Selection
When the code makes a
choice
, usually with an "
IF
"
statement.
One of the
four
main programming constructs
View source
Sequence
Two or more
lines of code
that are
executed
in order,
top to bottom.
One of the
four
main programming constructs
View source
Subroutine
A section of code that
performs
a particular
task
, a
function
or
procedure
, one of the four main programming
constructs
View source
variable
A
named memory location
holding a value that can
change
during a program, it can be
global
or
local
View source
function
A type of
subroutine
that executes a
block
of code and then returns a
value
View source
procedure
This subroutine
executes
a
block of code
that performs a
useful process
but does not return a
value
View source
global
Variables of this type remain in
memory
even when a
subroutine
ends, their scope is the
whole program
View source
local
Variables with
limited scope
, they are usually
deleted
when the
subroutine ends
, thus
saving memory
and
preventing errors
View source
scope
The
portion
of a program in which a
local variable
is
usable
, usually the
subroutine
where it is
declared
View source
parameter
A variable declared in a
subroutine definition
, a
and b
are parameters in this code:
SUBROUTINE
add(a, b) result ← a + b
RETURN resultENDSUBROUTINE
View source
Call
A
line of code
that causes a
subroutine
to run by using its
name
, for example answer ← add(2, 3) will run the function "
add
" and store the result in the variable "
answer
"
View source
Structured programming
Dividing a task into
smaller
tasks before coding, and
writing
each sub-task as a
subroutine.
It makes
debugging
and
maintenance
easier
View source