1.1 Algorithms Flashcards
What does ‘unambiguous’ mean?
It means that the instructions cannot be misunderstood.
Simply saying “turn” would be ambiguous because you can turn either left or right.
All instruction given on a computer must be unambiguous, otherwise, it would not know what to do.
What is a ‘sequence’?
It is an ordered set of instructions.
What is an ‘algorithm’?
It is a precise method for solving a problem.
What is ‘High-level programming language’?
It is a programming language that resembles natural human language.
What is a ‘flowchart’?
It is a graphical representation of an algorithm.
Each of the steps in the algorithm is represented by a symbol. Symbols are linked together with arrows showing the order in which steps are executed.
What is a ‘pseudo-code’?
It is a structured, code-like language that can be used to describe an algorithm.
What is a ‘variable’?
It is a ‘container’ used to store data.
The data stored in a variable is referred to as a value.
The value stored in a variable in not fixed. The same variable can store different values during the course of a program and each time a program is run.
What is an ‘identifier’?
It is a unique name given to a variable or a constant. Using descriptive names for variables makes code much easier to read.
What is an ‘arithmetic operator’?
It is an operator that performs a calculation on two numbers.
What is a ‘constant’?
It is a ‘container’ that holds a value that never changes.
Like variables, constants have unique identifiers.
Construct
A component from which something is built.
Letters and numbers are the constructs we use to build our own language and convey meaning.
Selection
A construct that allows a choice to be made between different alternatives.
Iteration
A construct that means the repetition of a process.
An action is repeated until there is a desired outcome or a condition is met. It is often referred to as a loop.
IF…THEN…ELSE statement
This statement allows a choice to be made between 2 alternatives based on whether or not a condition is met.
Relational operator
An operator that compares 2 values.