Understanding the world’s most complex machine
The computer is the most complex machine humans have created and the programs that run on them can be even more complex.
You may think this would make it very difficult for you to learn to program a computer. However, no matter how complex programs are, they all depend on a small collection of basic ideas. And at their lowest level, the only thing computers really do is process two different voltages: one low and one high, which are represented by 0 and 1.
If you first learn some basic concepts, programming becomes far easier and makes more sense.
Describing algorithms
Computer programs depend on algorithms. An algorithm is a step-by-step procedure to solve a problem. If you were asked to make a cup of tea for someone, you would follow an algorithm in your head, which might involve decisions such as ‘which type of tea do you like?’, ‘do they have sugar?’, and ‘do they have milk?’.
Once a programmer has created a method, or algorithm, they code it in a computer language and run it. However, they need a way to describe algorithms before they start.
Computer programmers have invented two main ways to represent algorithms. One is a pictorial method called a flowchart and the other a word method called structured English.
Flowcharts
A flowchart is a pictorial method for describing a procedure or algorithm.
It uses five basic symbols.
Flowcharts always BEGIN and END with rounded shapes containing those words. Any action that needs to be performed is drawn in a rectangle. Any information (input or output) needed from a user of the program or any information given to the user is drawn in a parallelogram.
Finally, any question or decision is drawn in a diamond. These decisions always have one flowline entering them and two flowlines leaving them: one for when an answer to a decision is True and one for when it is False.
Here is a flowchart for preparing a bath. It might form the first idea for coding a program to automatically fill a bath
ACTIVITY 10: Flowcharts
Arrange the pieces from the handout in a flowchart describing an algorithm for making a cup of tea.