2.1 - producing algorithms Flashcards

1
Q

Algorithms in pseudocode

A

Most programs are written using programming language. They have specific syntaxes that need to be used

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

What is pseudocode

A

It is not an actual programming language. Instead, it is a simple way of describing a set of instructions in a manner that resembles a programming language. It has its own syntax, some of which is very similar to many actual programming languages. Any algorithms designed using pseudocode will not run unless they are converted into an actual programming language.

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

Advantages of pseudocode

A
  • pseudocode is similar to a programming language, it can be quickly and easily converted into an actual programming language
  • fairly easy to understand, even for non-programmers
  • does not matter if there are errors in the syntax - it is usually still obvious what is intended
  • changes to the design can be incorporated quite easily
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Disadvantages of pseudocode

A
  • can be hard to see how a program flows
  • can be time consuming to produce
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a flow diagram

A

A diagram that shows an overview of a
program. Flow diagrams normally use standard symbols to represent the different types of
instruction. These symbols are used to construct the flowchart and show the step-by-step solution to the problem. Flow diagrams are sometimes known as flowcharts.

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

What does a line in a flow diagram represent

A

Flow from one component to the next

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

What does a rectangle in a flow diagram represent

A

Process - an action

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

What does a rectangle with two lines represent in a flow diagram

A

Subroutine

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

What does a parallelogram in a flow diagram represent

A

Input/ output

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

What does a diamond in a flow diagram represent

A

Decision

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

What does a round rectangle in a flow diagram represent

A

Start/ stop

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

Two types of programming problems

A

Logic
Syntax

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

What is a syntax error

A

A syntax error occurs when code written does not follow the rules of the programming language. A program will not run if it has syntax errors. Any such errors must be fixed first.

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

What is a logic error

A

A logic error is an error in the way a program works. The program simply does not do what it is expected to do.

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