Unit 2.8 Subprograms definitions Flashcards

(7 cards)

1
Q

What is a subprogram?

A

It’s a self-contained block of code that performs a specific task. It can be called by the main subprogram or other subprograms when it’s needed.

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

What is a procedure?

A

Its a subprogram that does not return a value

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

What is a function?

A

Its a subprogram that returns a value

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

What is an argument?

A

It’s a piece of data that is provided as an input to a subprogram

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

What is a local variable?

A

a variable that can be used only from within the subprogram. (local variable is destroyed when the subprogram is finished).

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

What is a parameter?

A

a variable that represents an argument in a subprogram.

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

What is a global variable?

A

It’s a variable that can be accessed from anywhere in the main programs, including subprograms

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