Back to marketplace

2.2.6. Programming Techniques

No description yet. This curated deck is ready for daily study.

Total cards: 18•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (18)

#1
Front (Question)

Sequence

Back (Answer)

the code is executed line by line, from top to bottom (sequentially)

#2
Front (Question)

Branching/ selection

Back (Answer)

BRA - always branch BRP - branch if the value is positive (or zero) BRZ - branch if the value is zero A certain block of code is run if a specific condition is met, using IF statements

#3
Front (Question)

Iteration

Back (Answer)

A block of code is executed a certain number of times (FOR loop) or until a condition is met (WHILE loop)

#4
Front (Question)

What is Recursion

Back (Answer)

• Where a subroutine calls itself within its own subroutine until a (stopping) condition is met.

#5
Front (Question)

Advantage of Recursion

Back (Answer)

The code is represented in fewer lines of code

#6
Front (Question)

Disadvantages of Recursion

Back (Answer)

• inefficient use of memory. If the subroutine calls itself too many times, there is a risk of stack overflow which will cause the program to crash • errors within recursion are difficult to trace

#7
Front (Question)

Global Variables

Back (Answer)

Can be accessed across the whole program

#8
Front (Question)

Global variable disadvantages

Back (Answer)

• can be unintentionally overwritten - requires more memory as they aren’t deleted once the subroutine is completed.

#9
Front (Question)

Local variables

Back (Answer)

local variables have a limited scope which means that they can only be accessed within the subroutine in which they were defined in

#10
Front (Question)

Local variable advantages

Back (Answer)

• ensures subroutines are self-contained (good practice in coding) • multiple local variables with the same name can exist in different subroutines (won’t overwrite each other)

#11
Front (Question)

Modularity (top-down programming)

Back (Answer)

Splitting large, complex problems into smaller self-contained modules - makes it easier to divide tasks between a team as each component is self contained

#12
Front (Question)

Procedure and function similarity

Back (Answer)

Procedures and functions are both named blocks of code that perform a specific task

#13
Front (Question)

Procedure vs function

Back (Answer)

Procedures don’t have to return a value whereas a function must always return a value

#14
Front (Question)

IDEs

Back (Answer)

• A program which provides a set of tools to make it easier to write, develop and debug code • Debugging tools have run-time detection of errors to show where they may have occurred • Stepping which allows you to monitor the effect of each individual line of code by executing line by line • Source code editor which provides features such as autocompletion of words, indentation, syntax highlighting and automatic brack completion

#15
Front (Question)

Class

Back (Answer)

A class is a template for an object and defines the state and behaviour of an object It is not an object itself. It is a template used to set or define what attributes and methods an object has. Once you have defined a class, you can easily reuse that class and create many objects of that class.

#16
Front (Question)

Inheritance

Back (Answer)

subclasses inherit methods and attributes from the superclass. Using inheritance, you can reuse the code from a class and extend its attributes and methods.

#17
Front (Question)

Encapsulation

Back (Answer)

When attributes are made private. Public methods are needed to read/ amend the attribute’s value - used to hide values or the internal state of an object preventing direct access by unauthorised third parties - reduces human error

#18
Front (Question)

Object Orientated Techniques

Back (Answer)

Attempts to capture or group info and data and related functionality (code) into structured items known as objects.