2.1.1 Flashcards

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

Define the term abstraction

A

Abstraction is the process of separating ideas from particular instances. It is a means of hiding detail. It is a representation of reality using symbols to show real life features.

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

Why is abstraction needed

A

Reduces processing requirements

Simplifies programming

Reduces memory requirements

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

Reusable components

A

Components that have already been written debugged and tested. They can be transplanted into new systems to save development time

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

Name the three programming constructs

A

Sequence, branching and iteration

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

Which two categories of loop is iteration split up into

A
  • Count-controlled

- Condition-controlled

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

Describe how the branching programming construct works

A

A certain block of code is run if a specific condition is met, using IF statements

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

What is recursion

A

A programming construct in which a subroutine calls itself during its execution until the stopping condition is met

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

What is the base case in recursion

A

A condition that must be met in order for the recursion to end

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

State two advantages of recursion

A

Can be represented in fewer lines of code

Easier to express some functions recursively than using iteration

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

State a disadvantage of recursion

A

Inefficient use of memory
Danger of stack overflow
Difficult to trace

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

Give two pieces of information that are stored on the call stack

A

Parameters
Return addresses
Local variables

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

Define scope

A

The section of the program in which a variable is accessible

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

Give advantages of using local variables over global variables

A

Less memory is used

Self-contained so unaffected by code outside the subroutine

Take precedence over global variables with the same name

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

What is top-down design

A

A technique used to modularise programs in which the problem is continually broken down into sub-problems, until each can represented as an individual, self-contained module which performs a certain task

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

State two advantages of modular design

A

Makes a problem easier to understand and approach

Simpler to divide tasks between a team

Easier to manage project

Self-contained modules simplify testing and maintenance

Greater reusability

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

Give another name for top-down design

A

Stepwise refinement

17
Q

What is the difference between procedures and functions

A

Functions must always return a single value while a procedure does not always have to return a value

18
Q

What does it mean to pass a parameter to a subroutine by reference

A

The address in memory of the parameter is passed to the subroutine so its value outside of the subroutine will be updated

19
Q

Features of IDEs

A

Stepping (whats stepping)

Variable watch

Breakpoints

Source code editor

Debugging tools

20
Q

What is encapsulation in OOP

A

When attributes are declared as private so can only be accessed and edited by public methods

21
Q

Describe the purpose of encapsulation

A

Program complexity is reduced by protecting data from being accidentally edited by other parts of the program

22
Q

Define the term parameter

A

(A description of) an item of data That is used as a variable within the subroutine

23
Q

What does it mean to pass a parameter to a subroutine by value

A

A local copy is stored, used and then discarded. The value of the original data is unchanged

24
Q

Global variables (features)

A

Global variables are defined at the start of the program

Exists throughout the program

Allows data to be shared by modules