programming techniques Flashcards

1
Q

IDE

A

software which allows the user to enter, edit, compile/interpret and run programs

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

IDE - benefits

A
add line numbers
automatically indent
auto-complete commands
(un)comment regions
error reports
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

IDEs debugging: breakpoint

A

set a breakpoint in the program which will cause it to stop at that line

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

IDEs debugging: watch

A

set a watch on a variableso its value is outputted each time it’s changed

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

IDEs debugging: step through

A

step through the program line by line

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

IDEs debugging: tracing

A

trace the execution of a program

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

algorithm

A

a sequence of instructions that can be followed to solve a problem

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

pseudocode

A

a semi-english programming shorthand used to aid in algorithm design

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

identifier

A

a name that points to a memory locatoin

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

assignment

A

assigning a value to the memory location

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

variable

A

a storage location who’s value can change during execution

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

constant

A

a storage location who’s value can’t change during execution

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

constants - benefits

A

reduce the risk of errors by reducing access to the memory location

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

selection

A

controls which statements are run based on whether a condition is met

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

IF

A

program flow is controlled by evaluating a boolean condition

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

SWITCH/CASE

A

used to make it easier to code multiple condition checks

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

interation

A

a sequence of instruction is repeated multiple times making the program more efficient

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

WHILE

A

condition is tested upon entry of the loop, statements wont run if the condition is initially false

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

DO UNTIL

A

condition is tested upon exit of the loop, statements will run once if the condition is initially false

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

infinite loops - uses

A

2d games, gathering sensor data

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

FOR

A

used to repeat a block of statements a specified number of times

22
Q

subroutine

A

a sequence of instructions that perform a specific task

23
Q

procedure

A

subroutine that doesn’t return a value

24
Q

function

A

subroutine that returns value(s)

25
Q

parameters

A

variable used in a subroutine to refer to one of the pieces of data provided as input to the subroutine

26
Q

arguments

A

value passed to the parameter

27
Q

passing by value

A

the value of the arguments in the calling statement is copied to the variable parameter

changes to parameters don’t affect corresponding arguments

28
Q

passing by reference

A

the address of the arguments is passed to the parameters

any changes to the parameters will affect corresponding arguments

29
Q

local variable

A

can only be accessed in the subroutine it’s defined in

30
Q

global variable

A

defined in the main program and can be accessed from anywhere

31
Q

local variable - advantages

A

subroutines can be independent and reused

no chance of accidental changes

32
Q

modular programming

A

breaking tasks into subtasks until each module performs a single function

33
Q

modular programming - advantages

A

programs are more easily and quickly written
large programs are broken down thus easier to manage
each module can be individually tested
modules can be reused
larger programs are easier to debug/maintain

34
Q

recursion (essential charactersistics)

A

stopping condition which must be reached after a finite number of calls (if not stack overflow will occur)

routine calls itself for input values outside of the stopping condition

35
Q

recursion (how)

A

each time a subroutine is called, the return address, parameters and local variables are pushed onto the stack

36
Q

call stack

A

every time a subroutine is called the return address is put on the call stack if this is done too many times the stack will overflow the max memory capacity

37
Q

class

A

a template for an object which defines its attributes and methods

38
Q

attributes

A

normally private, to ensue attributes can’t be changed without executing a method

39
Q

methoeds

A

generally public

40
Q

encapsulation

A

wraps the attributes and methods in the class definition, hiding details of the implementation from the user

41
Q

object

A

an instance of a class

42
Q

constructor

A

a method used to create a new object in a class

43
Q

instantiation

A

creating an instance of an object

44
Q

inheritance

A

ability to definite a child class which inherits the attributes and methods of a parent class

45
Q

polymorphism

A

the ability of a programming language to process objects differently depending on their class

46
Q

OOP advantages

A

code reuse, encapsulation, software maintenance

47
Q

code reuse (OOP)

A

classes created in one program can easily be saved in a library and reused in other programs –> faster development

48
Q

encapsulation reducing complexity (OOP)

A

once an object is created its not necessary to know how its methods are implemented

attributes can be hidden from the user preventing accidental changes

49
Q

software maintenance

A

object oriented programs are easier to modify and maintain

50
Q

instance method pseudocode

A

public procedure new(parameter)
atr = prameter
endprocedure