Algorithms Notes Flashcards
Computer programs:
To communicate with a computer program, we have to tell it what to do, step by step. This is done using…?
a computer program. In order to write a computer program, we must first analyse the task and there are a number of techniques to help with this.
Algorithm…?
A set of step by step instructions for solving a problem. It is written using ordinary English.
Structure diagram…?
Are a pictorial way of representing the logic of an algorithm.
Pseudocode…..?
A method of expressing the logic of an algorithm using statements.
Algorithms normally start with an _____ and end with an _____.
Input, output.
Algorithms can be thought of as…?
- A series of mechanical, repetitive, routine processes.
- A complete set of unambiguous instructions needed to perform a task or solve a problem.
- A clear description of how a computer is to proceed in an organised way through a sequence of elementary steps (a computer program).
Characteristics of an Algorithm…?
- unambiguous
- precise
- finite
- effective
What Algorithms are used in computer systems…?
In any computer system, many algorithms are used. For example, some of the algorithms used by an ATM (Automatic Teller Machine) are:
- Checking that the correct pin number has been entered.
- Performing a withdrawal of cash
- Performing an account balance inquiry.
Structure diagrams are used to…?
represent the logic of an algorithm. The first step is to break the algorithm into a beginning, a middle and an end.
A structure diagram must be read in the correct order…?
first the name of the algorithm at the top and then the beginning, middle and end are read across from left to right.
Structure diagram symbols:
A rectangle represents…?
Process, summary or name.
Structure diagram symbols:
A polygon represents….?
Input or output.
Structure diagram symbols:
Loop or iteration…?
Rounded Rectangle.
Structure diagram symbols:
If statement or condition…?
Hexagon.
Algorithms have 3 parts
Beginning…?
Middle …?
End…?
- initialize variables and totals, get inputs.
- main part, usually has loops and/or conditions (IF), processes, outputs.
- may have outputs, summary statements.