programming techniques C-D

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/10

encourage image

There's no tags or description

Looks like no tags are added yet.

11 Terms

1
New cards

What is a subroutine?

Named section of code that can be called by writing the subroutines name jn a program statement

2
New cards

What is a procedure?

Set of instructions that will be executed when the procedure is called

3
New cards

What is a function?

Contains a set of instructions that will be executed but returns a value when its finished executing

4
New cards

What is a local variable?

A variable which is only accessible within a specific part of the program. They are local to a subroutine and can only be called within it.

5
New cards

What is a global variable?

Variable which can be accessed anywhere in the program and they can be updated in any part of the program.

6
New cards

What is modularity?

The process of breaking a large provlem jnto smaller separate sections called modules

7
New cards

Why is modularity useful?

It is easier to understand since each module has a specific purpose

Its easier to test since you can test each module separately

It is easier ti debug since errors are easier to locate within it

It is easier to maintain since you can change ine module without affecting the whole program


8
New cards

Difference between a procedure and function?

Procedure does not return a value whereas function does.

9
New cards

What is passing by value?

The subroutine gets a copy of the data

10
New cards

What is passing by reference?

Giving the function direct access to the original data

11
New cards