Functions and Procedures Flashcards

(7 cards)

1
Q

Procedure definition

A

Block of code that is designed to perform a specific task. Procedures do not have to return a value

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

Function definition

A

Block of code that is designed to perform a specific task that has to return a value

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

How many values can a procedure return?

A

Multiple

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

How many values can a function return?

A

It must return 1 and only 1 value

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

How can parameters be passed into a subroutine?

A

By value or by reference

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

What happens when a parameter is passed by value?

A

Its treated as a local variable, the original is unnaffected

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

What happens when a parameter is passed by reference?

A

the address of the parameter is given so the original will be updated

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