Back to marketplace

2.2.1 FINAL Programming techniques

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

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

Card preview (24)

#1
Front (Question)

What is a data type?

Back (Answer)

A classification of data into groups

#2
Front (Question)

What is an integer?

Back (Answer)

Used to represent whole numbers, either positive or negative

#3
Front (Question)

What is a real?

Back (Answer)

Used to represent numbers with a fractional part, either positive or negative

#4
Front (Question)

What is chr?

Back (Answer)

Used to represent a single character such as a letter, digit or symbol

#5
Front (Question)

What is a string?

Back (Answer)

Used to represent a sequence of characters

#6
Front (Question)

What is boolean?

Back (Answer)

Used to represent true or false values

#7
Front (Question)

What is casting?

Back (Answer)

When you convert one data type to another data type

#8
Front (Question)

What is a programming construct?

Back (Answer)

Determines the order in which lines of code are executed

#9
Front (Question)

State the 3 types of programming constructs

Back (Answer)

Sequence, Branching, Iteration

#10
Front (Question)

What is a sequence?

Back (Answer)

• Refers to lines of code which are run one line at a time • The lines of code are run in the order that they are written from the first line of code to the last line of code

#11
Front (Question)

What is a selection?

Back (Answer)

• The flow of the program is interrupted and a condition is tested • Outcome of the condition will then determine which lines/block of code is run next. Two ways to write selection statements: • IF statement: test conditions sequentially SWITCH statement: test an expression against multiple possible constant values

#12
Front (Question)

What is an iteration?

Back (Answer)

• Repeating a line or block of code using a loop. It can be: • Count controlled: When the code is repeated a fixed number of times (for loop) • Condition controlled: When the code is repeated until a condition is met (while loop)

#13
Front (Question)

What is a SWITCH/CASE statement?

Back (Answer)

• Type of conditional statement that provides an alternative way to perform multiple comparisons based on the value of an expression • Useful when you have a single expression that you want to compare against multiple possible values

#14
Front (Question)

What is a for loop?

Back (Answer)

Count controlled loop that will repeat a fixed number of times

#15
Front (Question)

What is a while loop?

Back (Answer)

Condition controlled loop that will repeat until a condition is met - Provides a flexible way to handle situations where the number of iterations in unknown in advance

#16
Front (Question)

What is modularity?

Back (Answer)

Where problems are broken down into more manageable pieces - Each piece of the problem should be carried out by one single subroutine

#17
Front (Question)

What are subroutines?

Back (Answer)

• Standalone blocks of code and when called, they will complete a task • The promote code reusability, modularity and organisation, enabling a programmer to write efficient and maintainable programs

#18
Front (Question)

What is a function?

Back (Answer)

Block of code that takes in 0, 1 or more parameters, performs a set task and return a value

#19
Front (Question)

What is a procedure?

Back (Answer)

Block of code that takes in 0, 1 or more parameters and performs a set task

#20
Front (Question)

What is a parameter?

Back (Answer)

Pieces of data which are passed into the function or procedure to allow it to complete a task

#21
Front (Question)

What are the two ways of passing a parameter?

Back (Answer)

• Passing by value • Passing by reference

#22
Front (Question)

What does it mean by parameter passing by value?

Back (Answer)

• A copy of the actual value is made and assigned to the function’s parameter • Any changes to the parameter within the function’s scope do not affect the original value outside the function • Function works w/ and changes its own local copy of the value • Suitable when you want original data to be protected from being modified within the function • When function ends, copy of the value is destroyed • Can lead to performance overhead when working with large data structures since a copy is made

#23
Front (Question)

What does it mean by parameter passing by reference?

Back (Answer)

• Function receives the memory address of the value rather than a copy of the value • Any changes made to the parameter within the function directly affect the original value outside the function • Both the function and the calling code share the same memory location • Efficient for working w/ large data structures • Can lead to unexpected side effects if not handled carefully, as changes made within the function affect other parts of the program

#24
Front (Question)

What is recursion?

Back (Answer)

When a function calls itself to solve a problem or execute a task - Uses idea of self-reference to break down complicated problems into more manageable subproblems