Algorithms is method expressed in a finite list of well-defined instructions, for calculating a function. Algorithms are used to process calculations, data, and automated reasoning.
2. Pseudocode
The pseudocode is a compact and informal heigh-level description of the operating principle of a computer program, or other algorithms.
3. Machine Language
Machine Language is a system of atomic instruction executed directly by a computer's central processing unit. Each instruction performs a very specific task, typically either an operation on a unit of data, of a jump opertion.
4. High Level Computer Language
A high-level programming language is a programming language with strong abstraction from the details of the computer. In comparision to low-level programming languages, it may use natural language elements, be easier to use, of be from the specification of the program, making the process of developing a program simpler and more understandable with respect to a low-level language.
5. Flowchart
A flowchart is a type of diagram that represents an alogrithm or process, showing the steps as boxes of various knids, and their order by connecting these with arrows, giving a step-by-step solution to a given problem.
![]() |
| A flowchart of how use a non-functioning lamp |
6. Sequence
![]() |
| An infinte sequences of real numbers (in blue). This sequence is neither increasing, nor decreasing, nor convergent, nor Cauchy. It is however bounded. |
A sequence is an ordered list of objects (or events). Like a set, it contains mebers (also known as elements or terms), and the number of terms (possibly infinite) is called the legnth of the sequence. Unlike a set, order matters and exactly the same elements can appear multiple times at different positions in the sequence. A sequence is a discrete function.
7. Selection
Selection is where you make a choice between options. It usually contians 'if': such as IF the green light is still on.
8. Repetition
Repitition is the act of repeating a process, or single task/job.
Then with the aid of class discussions, write an algorithm for the following processes;
1. opening a door and entering a room.
Turn 180 degrees. Move two steps to 90 degrees right. Grasp the door handle. Turn the door handle 90 degrees right and hold this position. Holding the previous position, push the door.
2. Negotiating traffic lights as you drive down a street.
Whilst driving towards the traffic light check the colour of the light about 20m before reaching the traffic lights. If the light is green continue at the same speed . If the light is orange gradually slow down to stop at the traffic lights. If the light is red, quickly slow the pace of the vechile, to ensure that you halt at the traffic lights.
In your algorithm write each step of the process on a new line. Remember not to assume the computer knows anything.


No comments:
Post a Comment