Programming Techniques Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is selection?

A

A section of code that will only run if a certain condition is met

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

What is sequence?

A

A set of instructions, followed one after the other

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

What is iteration?

A

A repeating process (usually set by a for loop)

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

What is branching?

A

Another word for selection

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

What is the scope of a variable?

A

Whether it is a local or global variable

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

What is a local variable?

A

A variable declared within a subroutine that is destroyed at the end of it

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

What is a global variable?

A

A variable declared outside a subroutine that can be accessed at any point during it

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

What are the negatives of using global variables?

A
  • Can be unintentionally overwritten
  • Takes up more memory than local variables
  • Can cause potential naming conflicts
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is modularity in programming?

A

Breaking a large program down into smaller chunks

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

What are the 2 different types of subroutine?

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

What is a procedure?

A

A module of code that can take parameters but cannot return a value

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

What is a function?

A

A module of code that can take parameters and returns a value

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

What are the 2 methods of passing data into a subroutine?

A
  • Passing by reference
  • Passing by value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly