### Flowcharts

We talked about what an algorithm is in the previous sections, but it is also important to know how algorithms can be developed. Using flowcharts is a visual way to explain the logic of an algorithm and often helps us to decompose a problem far more than writing in pseudocode straight away.

### Identifying the START and STOP of the algorithm

The terminator shows where the logic begins, and then comes back again at the end.

"I'll be back"!

Flowcharts use a number of different shapes and can become quite complex. At GCSE, there are four major shapes that you will need to be familiar with:

• Terminator
• Process
• Decision
• Input / Output

When flowchart shapes are used correctly, they break down processes into much more detailed explanations. Breaking a problem down, is known as decomposition.

Processes are shown using a square box and writing the action inside the box. Eg. x = x + 1

If you have more than one process in a sequance, it’s better to divide these into separate process boxes.

### Identifying an action undertaken by the system

Examples of processes are assigning variables a value, calculating a new value, writing to a file...

### The I/O box is used for the user entering or viewing data from the system

Whereas the process is used for the system assigning or calculating values that the user may or may not see

It’s important to remember that a flowchart shows the flow of the logic of a program. Each shape should be connected using arrows.

If there are multiple arrows leading from a shape (usually a decision), you can make this even clearer by labelling the arrows. This is usually done by writing the label above the arrow.

Decision shapes are particularly useful as they allow us to create the logic for the conditions seen in selective statements (IF & CASE), and iterative statements (WHILE, FOR, & DO UNTIL).

The arrows for decisions are particularly important as they determine the flow of the program.

### Two or More

Usually, a decision will just have two: TRUE or FALSE

However, sometimes there may be multiple outputs to reflect a CASE statement.