2.2 problem solving and programming

0.0(0)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/35

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

36 Terms

1
New cards
sequence
\-code is executed line by line, top to bottom
2
New cards
selection/branching
\-a particular block of code runs if a specific condition is met

\-IF and ELSE statement
3
New cards
iteration
\-count controlled

\-condition controlled

\-FOR, WHILE, REPEAT UNTIL
4
New cards
count controlled iteration
\-block of code executed a certain amount of times
5
New cards
condition controlled iteration
\-block of code is executed until a condition is met
6
New cards
recursion
\-a subroutine that calls itself during execution

\-continues until a stopping condition is met
7
New cards
recursion advantages
\-can be represented in fewer lines of code

\-some functions are easier to express recursively
8
New cards
recursion disadvantages
\-risk of stack overflow if memory runts out

\-difficult to trace
9
New cards
local variable
\-can only be accessed within which they were defined

\-deleted once the subroutine ends

\-multiple with the same name can exist within different subroutines
10
New cards
local variable advantages
\-memory efficient
11
New cards
local variable disadvantages
\-harder to trace where values are passed
12
New cards
global variable
\-can be accessed across the whole program

\-not deleted until the program terminates so may use more memory and unnecessarily
13
New cards
global variable advantages
\-easier to program

\-simpler to follow

\-easier to debug
14
New cards
global variable disadvantages
\-memory inefficient

\-not good programing technique
15
New cards
modular programming
\-technique used to split large complex problems into smaller self contained modules
16
New cards
modular programming advantages
\-easier to manage a project and divide tasks within a team

\-each component can be dealt with individually simplifying the process of testing and maintenance

\-improves reusability of components
17
New cards
top down design
\-problem is broken down into sub problems until each is represented as an individual, self contained module that performs a certain task
18
New cards
functions and procedures
\-blocks of code that perform a certain task

\-functions return a value, procedures do not

\-parameters can be passed by value or by reference
19
New cards
passing parameters by values
\-a copy of the value is passed into the subroutine and discarded at the end

\-its value outside the subroutine is unaffected
20
New cards
passing parameters by reference
\-address of the parameter is given to the subroutine

\-value of the parameter will be updated at the given address
21
New cards
Integrated development environment (IDE)
\-program that provides a set of tools to make it easier to write, develop and debug code
22
New cards
features of IDEs
\-stepping

\-variable watch

\-breakpoint

\-source code editor

\-debugging tools

\-colour coded syntax
23
New cards
Class (OOP)
\-template for an object

\-define the state (attribute) and behaviour (method) of an object
24
New cards
object (OOP)
\-instance of a class
25
New cards
Constructor (OOP)
\-creates an instance of an object from a class
26
New cards
inheritance (OOP)
\-when a child class take on attributes/methods from a parent class
27
New cards
encapsulation
\-prevents attributes from being directly accessed
28
New cards
decomposition
\-breaking down a problem into smaller sub problems that can be represented as a self contained subroutine
29
New cards
advantages of problem decomposition
\-makes projects and teams easier to manage

\-modules can be designed, developed and tested individually

\-modules can be developed in parallel
30
New cards
divide and conquer method
\-problem is halves with every iteration

\-each subproblem is solved, usually recursively

\-solutions to the subproblems are recombined/merged
31
New cards
divide and conquer
\-simplifies complex problems very quickly

\-applied in quick sort, merge sort and binary search
32
New cards
backtracking
\-finding a solution to a problem by building on visited paths that are known to be correct

\-once a path is found to be invalid the algorithm backtracks to the previous stage
33
New cards
data mining
\-used to identify patterns or outliers in large data sets

\-finds trends and correlations that aren’t immediately obvious

\-can be used to predict future trends
34
New cards
heuristics
\-finds an approximate solution when finding the best solution will take too long
35
New cards
performance modeling
\-simulating the behaviour of a model under different circumstances

\-cheaper, safer, less time consuming method of testing appliances
36
New cards
visualisation
\-data is presented in a way that is easier for humans to understand