Programming Flashcards

1
Q

What is a procedure?

A

A subroutine that does not return a value

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

What is a function?

A

A subroutine that return a value

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

How can you tell if a variable is a constant?

A

Named with all capital letters e.g. EMPTYSTRING

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

What is a local and global variable?

A
  • A local variable is declared in a subroutine or similar
  • A global variable is declared at the highest possible level in a program so that it can be used in any lower level statements
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are programming paradigms?

A

Approaches to programming

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

What are the two main paradigms in programming?

A

1) Functional programming
2) Imperative programming

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

What are the two main types of imperative programming?

A

1) Procedural programming
2) Object-Oriented programming

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

What is functional programming?

A

Programming that has no variables, and instead uses functions as mappings from one value to another

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

What is imperative programming?

A

Programming that has commands that the computer performs in a specific sequence

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

What is procedural programming?

A
  • Programming made up of imperative commands that are run sequentially
  • Uses sequence, selection and iteration
  • Broken up into smaller parts or modules using subroutines
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the main parts of the structured approach to programming?

A

1) Organise programs into subroutines and modules by using hierarchy charts to break a program down

2) Store data in variables and constants with meaningful identifiers

3) Program to the interface by using subroutines

4) Use local variables instead of global variables

5) Use indentation, spacing and comments

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

What are the advantages to using the structured approach to programming?

A
  • Can individually test subroutines and modules
  • Modules with related subroutines make it easy to navigate for developers
  • Indented code is easier to read
  • Comments can explain how program works to other developers
  • Meaningful identifiers make it easier to follow
  • Parameters and return values to pass values into and out of subroutines reduces likelihood for errors
How well did you know this?
1
Not at all
2
3
4
5
Perfectly