Algorithm design and problem solving (paper2) Flashcards

1
Q

What are the 4 stages of the program development life cycle?

A

-Analysis
-Design
-Coding
-Testing

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

What is the analysis stage?

A

Abstraction, decomposition of the problem, identification of the problem and the requirements

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

What is the design stage?

A

Decomposition, structure diagrams, flowcharts, pseudocode

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

What is the coding stage?

A

Writing the program code and iterative testing

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

What is the testing stage?

A

Testing the program code with the use of test data

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

What is abstraction?

A

Abstraction involves identifying the key parts of the problem and removing any unnecessary detail so it becomes easier to solve

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

What is decomposition?

A

Decomposition means breaking down a complex problem into smaller, manageable parts which are easier to solve

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

What are the 3 types of error?

A

-Syntax error
-Logic error
-Runtime error

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

What is a syntax error?

A

An error caused by a spelling or grammar mistake

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

What is a logic error?

A

An error where the program still runs but the output may be incorrect for example a > symbol rather than a < symbol

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

What is a runtime error?

A

An error that is detected whilst the program is still running. A division by zero will cause a runtime error

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

What are the steps involved in decomposition?

A

-Identifying the main problem

-Identifying the component parts of inputs, processes outputs and storage

-List the main sub-problems, sub-systems, functions or tasks

-Break these down into similar smaller sub-problems or sub-tasks which can then be completed separately

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

What can be used to show the structure of a problem in the program development life cycle?

A

Structure diagrams

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

What symbol represents a flow line in a flowchart? (Draw it)

A

An arrow

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

What symbol represents a decision in a flowchart? (Draw it)

A

Diamond

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

What symbol represents an input/output in a flowchart? (Draw it)

A

Paralleogram

17
Q

What symbol represents a subroutine in a flowchart? (Draw it)

A

Square with 2 lines

18
Q

What symbol represents a process in a flowchart? (Draw it)

A

Square

19
Q

What symbol represents a terminator in a flowchart? (Draw it)

A

Square with rounded sides

20
Q

How does a linear search work?

A

Each item will be checked one by one in the list until the item is found - if the item isn’t there then the list will be searched without success

21
Q

Write pseudocode for a linear search

A
22
Q

How does a bubble sort work?

A

A bubble sort works by repeatedly going through the list to be sorted, swapping adjacent elements if they are in the wrong order

23
Q

Write pseudocode for a bubble sort

A
24
Q

What are the types of validation checks?

A

-Range check
-Length check
-Type check
-Presence check
-Format check
-Check digit check

25
Q

What is a range check?

A

Data must lie within a given range

26
Q

What is a length check?

A

A string input must be greater than or equal to a minimum length

27
Q

What is a type check?

A

Data must be of the correct data type

28
Q

What is a presence check?

A

A string must not be empty

29
Q

What is a format check?

A

A postcode must conform to one of a number of set formats

30
Q

What is a check digit check?

A

-A check digit is an additional digit at the end of a product code

-It is designed to check that a valid product code has been entered

31
Q

What is a double entry verification?

A

-The input of data twice

-The 2 entries are compared and if they match the entry is accepted as valid

-Setting a password uses this verification

32
Q

What are the types of test data?

A

-Normal (typical) data
-Extreme data
-Boundary data
-Abnormal or erroneous data

33
Q

What is normal data?

A

Using examples of typical data that the program is designed to handle

34
Q

What is extreme data?

A

Largest and smallest acceptable value

35
Q

What is boundary data?

A

Includes both ends of the allowed range as well as invalid data that should not be allowed, just outside the range

E.G if the range is 0-50 then the boundary data would be -1, 0, 50, 51

36
Q

What is abnormal/erroneous data?

A

Data of the wrong type

E.G. Non numerical characters is a numeric field