Programming Techniques Flashcards

1
Q

Sequence (program construct)

A

Statements executed 1 after another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Selection (program construct)

A

Statements executed based on conditions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Iteration (program construct)

A

Count controlled- executed for fixed no times

Condition controlled- until condition met

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Encapsulation

A

Local variable means subroutine is self contained
Used independently

Or in OOP
State, method and attributes encapsulated to 1 entity
Attributes set to private, only accessed and changed by public methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Features of IDE

A

Code editor, error diagnostics (breakpoint, stepthrough, set a watch on a variable), run time environment, translator and auto documentation

CERTA

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Recursion

A
Subroutine calls itself
Stopping condition 
\+
Shorter than iteration 
-
If recursion is too long, stack over flow (run out of memory)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Object Orientated Programming

A

Attributes
State
Behaviours (actions)
Class (template for object, defines a + b)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Constructor

A

Creates object in class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Instantiation

A

Instances of class made, shares methods and attributes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Inheritance

A

Class inherits data and behaviour from parent class

Derived class is sub class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Polymorphism

A
Same code for different objects but they are processed depending on their data types and attributes
Parent class can have 1 method and will have different results depending on which sub class it’s used on
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Procedure vs Function

A

Both take parameters and perform tasks

Procedure does not necessarily return value but function always does

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Passing parameters + definition

A

By value: actual value passed to subroutine

By reference: the address and not value is passed to subroutine

Variable that allows for passing data between functions and procedures

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Pass by reference vs by value

A

Changes in memory vs changes copy of value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

A* vs Dijstras

A

A* uses heuristics
Help solve problem faster
Estimated distance from final node
Doesn’t need to find all possible solutions only searches for path based on lowest current distance travelled

How well did you know this?
1
Not at all
2
3
4
5
Perfectly