2.2.1 Programming Techniques Flashcards

1
Q

What is a statement?

A

Single instruction or step in a program

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

What is a procedure?

A

Subroutine that sends control signals

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

What is a subroutine?

A

Set of instructions performing a specific task as a part of a larger system

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

What is a parameter?

A

Data given to a function or a procedure.

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

What is a function?

A

subroutine that executes statements and returns a single value

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

What is a sequence ?

A

A structure of statements/instructions that are executed in written order.

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

What is selection?

A

Something that allows us to select statements which will be executed depending on the conditions.

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

What is iteration?

A

Something that allows us to execute a block of statements multiple times.

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

Types of Iteration?

A

CONDITION_CONTROLLED - does the instruction have to be executed ?
REPEAT UNTIL - Tests whether a loop needs to be executed again.
INFINITE LOOPS - forever loop usually caused by an error.
COUNT - CONTROLLED LOOP - Using a variable to determine whether an instruction has to be repeated

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

What is nesting ?

A

Using more than one type of constructs.

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

What are the 2 good programming standarts.

A

Indentation - putting code into blocks

Naming Forms - naming varuiables and constants in a certain way so that is improves readibility

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

What are variables used for?

A

To store data items and allow them to be changed.A location in memory holding values.

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

What are arrays?

A

Many memory locations used to store multiple pieces of data, a dataset.

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

What are the two scopes of variables?

A

LOCAL

GLOBAL

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

What is a global variable ?

A

A variable that cann be read and modified by any bit of code. It makes it easier to pass values, making more efficient use of memory.However it increases the risk of the value being changed into something wrong, which would be hard to find.

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

What is a local variable?

A

A variable that can only be modified within a module or subroutine.It only contains values when the subroutine is accessed.I cannot be affected by other bits. However it heavily depends on memory locations.

17
Q

What is a function?

A

Algorithm that takes an input and produces an output for each input.

18
Q

Sequence of Function Events?

A

Line of function code comes up
Control is passed to function and instructions within it are executed
Control passes back to line calling function.
Any data from function is used in code instead of function

19
Q

What do we require to define a function?

A

A function name,parameters and process code.

20
Q

What is a difference between a procedure and function?

A

Function always has an output a procedure can have control signals.

21
Q

How can we pass parameters?

A

By Reference - pass the address of memory location where parameter is stored
By Value - passing value of actual parameter

22
Q

What does IDE stand for ?

A

Integrated Developement Enviroment

23
Q

What is an IDE?

A

a software application providing facilities for programmers for development

24
Q

What does an IDE provide?

A
availability to edit source code 
facility for program building 
version control 
debugging tool 
testing tool 
compilation tool
25
Q

What are the three debugging tools?

A
  • setting breakpoints - stop the program for inspection

- stepping through = seeing what happens at immedite points

26
Q

What is Recursion?

A

Ability that a subroutine can call on itself to complete its task until a condition is met. Bascilly it keeps looping until a conditon is met.

27
Q

What does Recursion consists of ?

A

RECURSIVE - code calling for next iteration

LIMITER - stops from an infinte loop

28
Q

What is Exception Handling ?

A

Something that is used to help program recover from run-time errors, so it doesnt crash or lose data.

  • setting input bounds etc.
29
Q

What is a CASE selection?

A

A multiple branch selection where the instructions excuted are based on a statement. Baqsiclly multiple options from selection.

30
Q

What does BRA mean?

A

Branch always. this jump instruction is always executed

31
Q

What does BRP mean?

A

Branch if positive.Only if the value in accumulator is positive