Section 2B - Programming Techniques Flashcards

1
Q

What is a subroutine?

A

A subroutine is a named, self-contained section of code that performs a specific task.

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

What are the 2 different types of subroutine?

A

Procedures and functions

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

What is a parameter?

A

To make the subroutine more useful, you can pass it one or more times through parameters. The parameter is a variable named in the subroutine heading that will receive and use whatever value you pass it.

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

What is a local variable?

A

Variables which functions and procedures may use their own variables, that do not get recognised in the main code.

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

What is a global variable?

A

A global variable is one which is declared in the main program an is recognised in all the subroutines.

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

What is a range check?

A

Whether a number or date os within a sensible/ allowed range

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

What is a type check?

A

Data is the right type such as an integer, a letter or text

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

What is length check?

A

Text entered is not too long or too short

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

What is a presence check?

A

Checks that some data has been entered

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

What is a format check?

A

Checks the format of, for example, a postcode or email address is appropriate.

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

What is a trace table?

A

Thos shows how the value of a variable changes as each step pf the algorithm is executed.

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