Back to marketplace

Programming techniques

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

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

Card preview (23)

#1
Front (Question)

Name the 3 programming constructs

Back (Answer)

• Sequence • Branching • Iteration

#2
Front (Question)

Which 2 categories of loop is iteration split up into?

Back (Answer)

• Count-controlled - Condition-controlled

#3
Front (Question)

Describe how the branching program construct works

Back (Answer)

A certain block of code is run if a specific condition is met, using IF statements

#4
Front (Question)

What is recursion?

Back (Answer)

A programming construct in which a subroutine calls itself during its execution until the stopping condition is met

#5
Front (Question)

What is the base case in recursion?

Back (Answer)

A condition that must be met in order for the recursion to end

#6
Front (Question)

State 2 advantages of recursion

Back (Answer)

• Can be represented in fewer lines of code - Easier to express some functions recursively than using iteration

#7
Front (Question)

State a disadvantage of recursion

Back (Answer)

• Inefficient use of memory • Danger of stack overflow • Difficult to trace

#8
Front (Question)

Give 2 pieces of information that are stored on the call stack

Back (Answer)

• Parameters • Return addresses • Local variables

#9
Front (Question)

Define scope

Back (Answer)

The section of the program in which a variable is accessible

#10
Front (Question)

What is meant by a local variable?

Back (Answer)

• Limited scope • Set or declared inside a function or other subprogram • Can only be accessed from within that subprogram

#11
Front (Question)

What is meant by a global variable?

Back (Answer)

• Can be accessed throughout a program - Declared or set outside any functions or subprograms

#12
Front (Question)

Give 2 advantages of using local variables over global variables

Back (Answer)

• Less memory is used • Self-contained so unaffected by code outside of the subroutine • Take preconditions over global variables with the same name

#13
Front (Question)

What is top-down design?

Back (Answer)

A technique used to modularise programs in which the problem is continually broken down into sub-programs, until each can be represented as an individual, self-contained module which performs a certain task

#14
Front (Question)

Give another name for top-down design

Back (Answer)

Stepwide refinement

#15
Front (Question)

State 2 advantages of a modular design

Back (Answer)

• Makes a problem easier to understand and approach • Simpler to divide tasks between a team • Easier to manage project • Self-contained modules simplify testing and maintenance • Greater reusability

#16
Front (Question)

What is the difference between procedures and functions?

Back (Answer)

• Functions must always return a single value - Procedure does not always have to return a value

#17
Front (Question)

What does it mean to pass a parameter to a subroutine by reference?

Back (Answer)

• Address of the variable is passed to the subprogram - If a variable is changed by the subprogram, it stays changed

#18
Front (Question)

What does it mean to pass a parameter to a subroutine by value?

Back (Answer)

• When you pass a parameter a copy is made for the subprogram • Changing the value in the subprogram does not change the original value

#19
Front (Question)

State 2 features of IDEs

Back (Answer)

• Stepping • Variable watch • Breakpoint • Source code editor • Debugging tools

#20
Front (Question)

What is encapsulation in object-oriented programming?

Back (Answer)

When attributes are declared as private so can only be accessed and edited by public methods

#21
Front (Question)

Describe the purpose of encapsulation in object-oriented programming

Back (Answer)

Program complexity is reduced by protecting data from being accidentally edited by other parts of the program

#22
Front (Question)

What is meant by inheritance?

Back (Answer)

Allows a class to inherit all methods and attributes of a parent class (as well as having its own)

#23
Front (Question)

What is meant by polymorphism?

Back (Answer)

The ability to use the same code to process different objects according to their type