What are the 3 programming constructs?
sequence selection iteration
What are the 2 catagroies of loop iteration is split up into?
count controlled
condition controlled
How does the selection programming construct work?
a certain block of code is run if a specific condition is met, using IF statements
What is recursion?
a programming construct where a subroutine calls itself during its execution until the base case is met
What is the base case in recursion?
a condition that must be met in order for the recursion to end
What are 2 advantages of recursion?
What are 3 disadvantages of using recursion?
inefficient use of memory
danger of stack overfow
difficult to trace
What are 3 peices of information that are stored on the call stack?
parameters
return adresses
local variables
What is the defenition of scope?
the section of the program where a variable can be accessed
What are 3 advantages of using local variables over global variables?
less memory is used
self contained, so unaffected by code outside of the subroutine
takes precedence over global variables with the same name
What is a top-down design? (2 things)
a technique used to modularise programs where the problem is continually broken down into sub-problems,
until each can be represented as an individual, self contained module that performs a certain task
What are 3 advantages of a modular design?
What is the difference between procedures and functions?
functions must always return a value whilst a procedure does not
What does it mean to pass a parameter to a subroutine by reference?
the memory address of the parameter is passed to the subroutine, so its value outside of the subroutine will be updated
What are features of IDE’s?
debugging tools
source code editor
variables watch
stepping
breakpoint
What does IDE stand for?
integrated development environment
What is encapsulation in object-orientated programming?
where attributes are declared as private so can only be accessed and edited by public methods
What is the purpose of encapsulation in object-orientated programming?
to reduce program complexity by protecting data from being accidentally edited by other parts of the program