SDD : Computational constructs Flashcards

1
Q

Global Variables

A

Global variables - accessed by every sub-program or module at all times. Always present in RAM during execution

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

Local Variables

A

Local variables - only accessed within the sub-program that they have been declared/created within. Only present in RAM during the execution of the sub-program where they are located

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

Disadvantages of gobal variables

A

Subroutines can change the variables by accident

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

Adavtages of local variables

A

More effecient in terms of memory

Removes naming clashes with other local variables in other subroutines

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

Actual parameters

A

Passes in to subroutines

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

Formal parametres

A

def addnumber ( FORMAL PARAMETRES)

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

Subprograms/routines

A

A sub-program is a block of code that can be called and accessed by a main program

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

Functions

A

are sub-programs designed to return value(s) which can be assigned to a variable

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

Procedures

A

Procedures are sub-programs designed to perform a series of commands with values sometimes passed to another part of the program

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

Converting character to ASCII

A

ord(“a)

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

converting ascii to character

A

chr(“a)

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

converting floating point numbers to substrings

A

original=24.54

int(original)

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

Substrings

A

[start:stop:step}

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