9.2.2 Structured English, Flowcharts and Pseudocode
The same algorithm can be communicated in several forms. This section develops the skill of documenting a solution using structured English, pseudocode or a flowchart, and of translating accurately between those representations without changing the algorithm itself.
By the end of this section, you should be able to:
- Explain the purpose and main features of structured English, pseudocode and flowcharts.
- Recognise and use the standard flowchart symbols for start/end, input/output, processing and decisions.
- Document a simple algorithm in any of the three representations.
- Write pseudocode from a structured English description.
- Write pseudocode by following a flowchart.
- Draw a flowchart from structured English or pseudocode.
- Check that two representations describe exactly the same inputs, operations, decisions and outputs.
Three Ways to Document One Algorithm
A representation is a way of communicating the logic of a solution. Changing the representation should not change what the algorithm does.
| Representation | How it communicates the solution | Main strength | Possible limitation |
|---|---|---|---|
| Structured English | Short command-style statements written in controlled natural language. | Easy to draft and discuss before formal notation is needed. | Can become ambiguous when commands or conditions are too informal. |
| Pseudocode | Programming-style keywords, identifiers and indentation without using one specific language. | Shows enough detail to support implementation and tracing. | Must still follow consistent conventions to remain clear. |
| Flowchart | Connected symbols show actions, decisions and the direction of control flow. | Makes routes, branches and loops visible. | Large algorithms can produce diagrams that are difficult to fit on one page. |
Structured English
Structured English uses a restricted form of everyday language. Each line should state a clear action, test or repetition rule. It is more precise than a paragraph, but less formal than pseudocode.
| Effective feature | Example | Why it helps |
|---|---|---|
| One action per line | READ the number of repair minutes | The order of operations is visible. |
| Command verbs | CALCULATE the labour charge | The required operation is explicit. |
| Named values | STORE the result as AmountDue | Later steps can refer to the same value. |
| Clear conditions | IF the customer is a member | The alternative route has a definite trigger. |
| Visible block endings | END IF | The scope of the condition is unambiguous. |
Pseudocode
Pseudocode describes an algorithm using recognised programming ideas while remaining independent of Python, Java, C++ or any other implementation language. Keywords and indentation expose the structure of the solution.
INPUT RepairMinutes
LabourCharge β RepairMinutes * 0.52
OUTPUT LabourCharge
Useful habits include:
- using meaningful identifiers rather than unexplained single letters;
- using the assignment symbol
βwhen a value is stored or updated; - indenting statements inside a decision or loop;
- using matching endings such as
ENDIF,ENDWHILEorNEXT; - following the pseudocode conventions required by the course.
Flowcharts and Their Symbols
A flowchart represents control flow visually. Arrows connect symbols in the order they are followed. Decision branches should be labelled so the reader knows which route represents each outcome.
| Symbol | Purpose | Typical content |
|---|---|---|
| Terminal | Marks where the algorithm begins or finishes. | |
| Input/output | Reads data or produces a result or message. | |
| Process | Calculation, assignment or other action. | |
| Decision | A Boolean condition with labelled outcomes such as Yes/No or True/False. | |
| Flow line | Shows which symbol is followed next. |
Different Appearance, Equivalent Meaning
A correct conversion preserves behaviour. The exact words and visual layout may change, but the same data must enter, the same operations must occur under the same conditions, and the same results must be produced.
| Check | Question to ask after translating |
|---|---|
| Inputs | Does the new representation read every value required by the original? |
| Order | Do dependent operations still occur in the correct sequence? |
| Processing | Are calculations and assignments unchanged? |
| Decisions | Are the same conditions tested, with the same actions on each branch? |
| Repetition | Do repeated steps begin, continue and stop under the same rule? |
| Outputs | Does the new version produce every required result? |
Worked Example: Community Repair Workshop Charge
A workshop charges 0.52 currency units per repair minute. Registered members receive a 12% reduction. The algorithm must input the repair time and membership status, then output the amount due.
1. Structured English
READ the repair time in minutes
READ whether the customer is a registered member
CALCULATE the labour charge at 0.52 per minute
IF the customer is a registered member
REDUCE the labour charge by 12 percent
END IF
DISPLAY the final amount due
2. Pseudocode
INPUT RepairMinutes
INPUT IsMember
AmountDue β RepairMinutes * 0.52
IF IsMember = TRUE THEN
AmountDue β AmountDue * 0.88
ENDIF
OUTPUT AmountDue
3. Flowchart
A Reliable Method for Converting Algorithms
Structured English β Pseudocode
- Underline the command in each line: input, calculate, compare, repeat or output.
- Replace descriptive data phrases with the agreed identifiers.
- Choose the corresponding pseudocode keyword or assignment statement.
- Indent statements controlled by a condition or loop.
- Add the closing keyword required by the construct.
- Trace the result against the original description.
Pseudocode β Flowchart
- Create one start terminal and one appropriate end terminal.
- Convert each input/output statement to an input/output symbol.
- Convert calculations and assignments to process rectangles.
- Convert each tested condition to a decision diamond.
- Label the branches and reconnect them at the correct point.
- Use arrows to show the exact order, including any route that returns for repetition.
Flowchart β Pseudocode
- Begin at the start symbol and follow the arrows rather than reading by page position.
- Write the pseudocode statement represented by each symbol.
- At a decision, identify both labelled outcomes before writing the block.
- Recognise a loop when an arrow returns to an earlier test or process.
- Use indentation to reconstruct the block structure.
- Check that every route reaches the correct next statement or end point.
Interactive: Representation Translator
Select an algorithm pattern, then move through the correspondences. The highlighted statement and flowchart node show how the same logical step appears in all three representations.
Common Mistakes and Misconceptions
- Copying the words but changing the logic, for example reversing the Yes and No branches.
- Using a process rectangle for input or output instead of the input/output symbol.
- Putting an action rather than a Boolean condition inside a decision diamond.
- Leaving decision branches unlabelled.
- Reading a flowchart from top to bottom while ignoring its arrows.
- Writing pseudocode as exact Python, Java or C++ syntax.
- Removing an apparently unimportant step that is required by another step later.
- Adding extra processing that was not present in the original algorithm.
Practice
Try these original questions
-
Convert the following structured English into pseudocode:
READ the number of reusable cups CALCULATE the deposit as 1.25 for each cup DISPLAY the deposit -
Draw a flowchart for this pseudocode:
INPUT BatteryLevel IF BatteryLevel < 25 THEN OUTPUT "Recharge soon" ELSE OUTPUT "Battery ready" ENDIF -
Write pseudocode for a flowchart that repeatedly inputs
SoundLeveluntil the value is at most 55, then outputs"Safe level". - Explain two differences between structured English and pseudocode.
- Explain why two correct representations may look different while still describing the same algorithm.
-
A flowchart decision asks
Temperature > 28?. The Yes branch starts a fan and the No branch leaves the fan off. Write an equivalent structured English description. - A student converts a pseudocode algorithm to a flowchart but omits one output statement. Explain why the two representations are not equivalent.
Review
| Question | Strong answer should include |
|---|---|
| What is structured English? | Controlled, command-style natural language used to document algorithm steps. |
| What is pseudocode? | A precise, language-independent, programming-style representation of an algorithm. |
| What does a flowchart show? | The order of actions and the routes taken through decisions and repetition. |
| How is input/output represented? | With an input/output statement in text or a parallelogram in a flowchart. |
| How is a condition represented? | With a conditional statement in text or a labelled decision diamond in a flowchart. |
| What makes two representations equivalent? | The same inputs, operations, conditions, routes, repetition rules and outputs. |