Back to marketplace

2.2.1 Programming techniques

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

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

Card preview (17)

#1
Front (Question)

What are the three programming constructs?

Back (Answer)

-sequence -selection -iteration

#2
Front (Question)

What is sequence?

Back (Answer)

-executing instructions one after another

#3
Front (Question)

What is selection? Give an e.g

Back (Answer)

-allows a program to change direction depending on the outcome of a condition (boolean expression) -e.g an IF statement

#4
Front (Question)

What is iteration? Give an e.g

Back (Answer)

-repeating sections of code -could be a FOR loop (a count-controlled loop) -could be a WHILE, DO…UNTIL or a REPEAT…UNTIL loop (condition controlled loop)

#5
Front (Question)

What is recursion?

Back (Answer)

-when a subroutine (often a function) calls itself from within its own subroutine

#6
Front (Question)

What are the three characteristics of a recursive function?

Back (Answer)

-contains a stopping condition (base case) -the subroutine should call itself for any input value (other than the base case) -stopping condition should be reachable within a finite number of times

#7
Front (Question)

Why does a recursive function need these characteristics?

Back (Answer)

-it may call itself indefinitely, resulting in stack overflow

#8
Front (Question)

What is a local variable?

Back (Answer)

-declared inside a subroutine -only accessible by that subroutine -created when the subroutine is called -destroyed when the subroutine ends

#9
Front (Question)

What is a global variable?

Back (Answer)

-declared at the top of a program, outside of any subroutine -accessible throughout the program -created when the program starts -destroyed when the program ends

#10
Front (Question)

What is the problem with using global variables?

Back (Answer)

-can make programs hard to test, debug and maintain -using global variables is generally considered poor programming practice

#11
Front (Question)

What is a module? (4)

Back (Answer)

-procedure -function -subroutine -method

#12
Front (Question)

What is a procedure?

Back (Answer)

-a block of code that takes in zero, one or more parameters and performs a set task

#13
Front (Question)

What is a function?

Back (Answer)

-a block of code that takes in zero, one or more parameters; performs a set task; and returns a value

#14
Front (Question)

What is modularity?

Back (Answer)

-The concept of breaking a large program/ problem down into smaller chunks -each module carries out a single specific task

#15
Front (Question)

How do you pass data into a subroutine?

Back (Answer)

-by value -by reference

#16
Front (Question)

What is an IDE?

Back (Answer)

A program that provides a set of tools and related functionality designed to maximise a programmers productivity

#17
Front (Question)

common IDE features(7):

Back (Answer)

-code editors -error diagnostics (reports errors) -runtime environments -translators -auto documentation -syntax highlighting -autocompletion