7B: variables/constants vs literal constants Flashcards

1
Q

what are constants

A

values which do not and should be changed

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

what are literal constants

A

particular value, must be manually changed, each use independent

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

when should literal constants be used

A

when assigned to variables which can be a constant identifier which does not change after declaration

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

meaningful identifiers

A

increased readability

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

what does meaningful variable names increase

A

maintainability + readability

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

what are meaningful identifiers used for

A

variables, subroutines, constants, modules

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

function of explanatory comments

A

describe what + how in source code
- documents changes made, programmer’s name, date + nature of changes

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

standard vs non-standard control structures

A

standard: sequence, selection, iteration
non-standard: exists, just don’t use

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

main lines should…

A
  • include minimal processing
  • consist of a series of calls to subroutines
  • determines top-down design
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

how to increase subroutine maintainability

A

one logical task per subroutine
- easier to understand, test, reuse, maintain

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