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
parameters
variable used in a subroutine to refer to one of the pieces of data provided as input to the subroutine
26
arguments
value passed to the parameter
27
passing by value
the value of the arguments in the calling statement is copied to the variable parameter changes to parameters don't affect corresponding arguments
28
passing by reference
the address of the arguments is passed to the parameters any changes to the parameters will affect corresponding arguments
29
local variable
can only be accessed in the subroutine it's defined in
30
global variable
defined in the main program and can be accessed from anywhere
31
local variable - advantages
subroutines can be independent and reused no chance of accidental changes
32
modular programming
breaking tasks into subtasks until each module performs a single function
33
modular programming - advantages
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
recursion (essential charactersistics)
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
recursion (how)
each time a subroutine is called, the return address, parameters and local variables are pushed onto the stack
36
call stack
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
class
a template for an object which defines its attributes and methods
38
attributes
normally private, to ensue attributes can't be changed without executing a method
39
methoeds
generally public
40
encapsulation
wraps the attributes and methods in the class definition, hiding details of the implementation from the user
41
object
an instance of a class
42
constructor
a method used to create a new object in a class
43
instantiation
creating an instance of an object
44
inheritance
ability to definite a child class which inherits the attributes and methods of a parent class
45
polymorphism
the ability of a programming language to process objects differently depending on their class
46
OOP advantages
code reuse, encapsulation, software maintenance
47
code reuse (OOP)
classes created in one program can easily be saved in a library and reused in other programs --> faster development
48
encapsulation reducing complexity (OOP)
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
software maintenance
object oriented programs are easier to modify and maintain
50
instance method pseudocode
public procedure new(parameter) atr = prameter endprocedure