Flow Chart Rules
Rules
- Every box should have arrows in and out. Exceptions: Start box and End box.
- No box should have more than one arrow in.
- No box should have more than one arrow out. Exception: The decision box.
- The decision box has two arrows out.
- Each box should correspond with one action.
- A parallelogram requesting data should have a corresponding parallelogram accepting the data.
- Request boxes correspond with printf statements.
- Accept boxes correspond with scanf statements.
- All boxes should be in sequence joined by lines with arrows to show the sequence.
- Boxes handling data should use the name of the variable in which the data is stored.
- Use parallelograms for I/O statements.
- Use Rounded rectangles for processing.
- Use circles for Start and End boxes
- Use diamonds for decision, including loop completed decisions (while).
For example, a program to read 2 numbers, add them and output the answer is similar to this:
The flowchart below shows the process of selecting 6 numbers in a set for use in the lotto. Technically, it also describes the steps followed by the TV numbers selection process.
Purpose
The use of flowcharts allow for an unambiguous expression of the sequence of instructions of the program. This is also know as the logic of the program. Whilst this method is not fool-proof it is an invaluable tool for getting your mind to approach a problem in a straight line.