Back to marketplace

2.2 Problem solving and programming

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 are the three types of programming constructs?

Back (Answer)

sequence branching iteration

#2
Front (Question)

Explain what we mean by sequence as a programming construct

Back (Answer)

when code is executed line-by-line, from top to bottom

#3
Front (Question)

Explain what we mean by branching as a programming construct

Back (Answer)

when a particular block of code is met if a specific condition is met examples are if and else statements

#4
Front (Question)

Explain what we mean by iteration as a programming construct

Back (Answer)

blocks of code which loop can be either: count controlled- blocks of code looping over a certain number of times condition controlled- blocks of code looping until a specific condition is met examples are DO, WHILE, FOR loops

#5
Front (Question)

Explain recursion

Back (Answer)

When a subroutine calls upon itself during its execution -continues until a stopping condition is met

#6
Front (Question)

What are some advantages to using recursion? (2)

Back (Answer)

-code can be represented in fewer number of lines -easier to express some functions recursively e.g. factorial

#7
Front (Question)

What are some disadvantages to using recursion (2)

Back (Answer)

-risk of stack overflow if memory runs out -difficult to trace

#8
Front (Question)

What is a scope and how is this related to variables?

Back (Answer)

-variables can be defined with a global or local scope -a scope is the section of code where the variable can be accessed

#9
Front (Question)

Explain what local variables are and their characteristics

Back (Answer)

variables which can only be accessed within the subroutine where they were defined

#10
Front (Question)

Explain what global variables are and their characteristics

Back (Answer)

variables which can be accessed through the whole program

#11
Front (Question)

What are some +/- of using local variables? (3, 1)

Back (Answer)

+won’t affect other sections of code +deleted once subroutine ends so doesn’t take up lots of memory +multiple local variables with same names but in different subroutines can exist -need to keep declaring in different sections of code if needed there

#12
Front (Question)

What are some +/- of using global variables? (1, 3)

Back (Answer)

+useful for values that need to be used by multiple parts of the program -if changed, it will affect other areas of code where it has been called upon -can unintentionally edit it -not deleted until program terminates so requires more memory

#13
Front (Question)

What is modular programming?

Back (Answer)

a technique used to split large/complex programs into smaller, self-contained modules

#14
Front (Question)

Why is modular programming useful? (3)

Back (Answer)

-easier to divide tasks between a team and manage projects -simplifies the process of testing and maintenance (each component can be tested individually -improves reusability of components

#15
Front (Question)

Explain a top down design/modules

Back (Answer)

-technique to modularise programs -problem is broken down into subproblems until each is is represented into individual, self-contained modules which perform a specific task -modules form blocks of code called subroutines

#16
Front (Question)

Explain functions

Back (Answer)

-blocks of code which perform a specific task -functions return a value -can pass parameters by value or by reference

#17
Front (Question)

Explain procedures

Back (Answer)

-blocks of code which perform a specific tasks -procedures output values -can pass parameters by value or by reference

#18
Front (Question)

What do we mean by passing a value by reference?

Back (Answer)

-address of parameter is given to the subroutine -value of parameter will be updated at the given address -changes the original data stored

#19
Front (Question)

What do we mean by passing a value by value?

Back (Answer)

-a copy of the value is passed to the subroutine and discarded at the end -the original value stored is unaffected

#20
Front (Question)

What is an IDE?

Back (Answer)

integrated development environment -provides a set of tools to make it easier for programmers to write, develop and bug code

#21
Front (Question)

What are some features of IDEs? (7)

Back (Answer)

-stepping (executes line by line to see how each line effects program) -variable watch (observes the contents of variable and how they change in real time through execution) -debugging tools (provides errors in lines during run-time) -autocompletion -syntax highlighting -breakpoints

#22
Front (Question)

What is a class?

Back (Answer)

a template for an object -defines state and behaviour for an object

#23
Front (Question)

How can we define the state and behaviour of an object?

Back (Answer)

state- using attributes behaviour- methods

#24
Front (Question)

What is an object?

Back (Answer)

a particular instance of a class