subroutines Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are the two main types of subroutines?

A

Procedures and functions.

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

What is the difference between procedures and functions?

A

Procedures do not return a value

functions do return a value

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

What is a parameter?

A

It is a variable in a function which is used to refer to a piece of data provided as an input to the function.

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

What is a local variable?

A

It is when a subroutine declares their own variable.

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

What are two features of a local variable?

A
  • They only exist while the subroutine is executing.
  • They are only accessible within the subroutine.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a return value?

A

It is a value which the function returns when it has completed a task.

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