Intro To Local Variables Flashcards

1
Q

Local variables

A

Function parameters defined inside functions body, destroyed opposite of order of creation in running time and must be defined as close to their first use.

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

Identifier’s scope

A

Determines where the identifier can be accessed in the source code

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

Scope

A

Compile time property

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

Local variable’s scope

A

Begins at the point of variable definition, ends at the end of the curly braces

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

Uses of functions

A
  • statements that appear more than once in a program
  • code thet has well defined inputs and outputs (ex. Input-unsorted list output-sorted)
  • when a function becomes too long, complicated, hard to understand
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

W hitespace

A

Characters that are used for formatting, space, tab and newline

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

Basic formatting

A
  • not enforced
  • function braces either on the same line as a statement or on its own line
  • each statement should start 1 tab in from the opening line
  • maximum 80 characters in a line
  • operators on the biggining of the next line
  • use whitespace to allign values or comments
How well did you know this?
1
Not at all
2
3
4
5
Perfectly