Algorithm Design and Pseudocode Flashcards

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

What are the four main stages in 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

Define what is meant by abstraction

A

Identifying the key parts of a program and removing any unnecessary detail so that it becomes easier to solve

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

Define what is meant by decomposition

A

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
4
Q

What are the main steps in decomposition?

A
  1. Identify the main problem
  2. Identify the component parts of inputs, processes, outputs and storage
  3. Break these down into smaller sub-problems
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you declare a variable in pseudocode?

A

DECLARE {variablename} : {variable type}

e.g. DECLARE StartNumber : INTEGER

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

How can you ensure your pseudocode is easy to understand?

A

Add a comment to explain the purpose of that line
Ensure the variable name is meaningful

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

What are the six types of validation checks?

A
  • Range check
  • Length check
  • Type check - Correct data type
  • Presence check - String can’t be empty
  • Format check
  • Check digit check
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is normal (typical) data?

A

Using examples of data that the program is designed to handle

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

What is extreme data?

A

The largest and smallest acceptable value (e.g. 1, 50)

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

What is boundary data?

A

Includes both ends of the allowed range (e.g. 1, 50) as well as the values just outside the range (e.g. 0, 51)

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

What is abnormal/erroneous data?

A

Data of the wrong type
e.g. letters in a numerical field

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

What will happen to your code if it encounters a syntax error?

A

It will prevent the code from running

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

What can syntax errors be caused by?

A

Mistakes in spelling or ‘grammar’ in the code

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

What will happen to your code if it encounters a logical error?

A

It will continue to run but may give an incorrect or unexpected output

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

What can logical errors be caused by?

A

Using y > 5 instead of y >= 5 could affect loop conditions or range checks

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

What is a runtime error?

A

An error that is detected while the code is running

17
Q

What can cause a runtime error?

A

Logical error, erroneous data input, division by 0

18
Q

Define what is meant by a selection statement.

A

Comprises an IF or CASE statement and a logical expression. Variables of the Boolean data type can only be true or false

19
Q

Define what is meant by an iteration statement.

A

Statements to be repeated are placed inside a loop structure (e.g. FOR or WHILE)