Problem solving/programming Flashcards

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

subroutine benefits

A

easier to read
- there are fewer long blocks of code to understand
more efficient
- blocks of code can be used once and re-written many times
more reliable
- each subroutine can be individually tested to make sure it works

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

parametres

A
  • special variables used to pass values into a subroutine
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

arguments

A
  • the actual values that are passed in
  • (through the parameter)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

local variable

A
  • a variable defined within a subroutine
  • has a local scope
  • can only be accessed within that subroutine
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

global variable

A
  • variable can be made global by adding the ‘global’ keyword before it when first used
  • may be accessed by any part of the whole program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

passing By Reference

A
  • function receives memory location of the data
  • will make changes to the original variable
  • will overwrite data in the original variable
  • will keep the changes after the function ends
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

passing By Value

A
  • function receives a COPY of the variable
  • will not overwrite the data in the original variable
  • will not keep the changes after the function ends
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

global benefits over local

A
  • don’t need to return a value
  • can be accessed from anywhere in the program
  • variable doesn’t need passing as a parameter
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

global drawbacks over local

A
  • increases memory usage (held in memory until full program execution is over)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

benefits of using reusable components

A
  • reduced testing requirements
  • saves time from having to write the same algorithm repeatedly
How well did you know this?
1
Not at all
2
3
4
5
Perfectly