Skip to content
SPM Tuition
Computer Science · Problem solving and algorithms

Designing a flowchart that works

You know the steps in your head but your flowchart arrows end up tangled or incomplete.

A flowchart shows an algorithm as symbols joined by arrows. A good one has a single start, a clear path for every outcome, and an end that every path reaches.

This lesson is part of problem solving and algorithms. If the steps themselves are unclear, revisit breaking a problem into smaller tasks.

What does each symbol mean?

Match each symbol to the kind of pseudocode it replaces.

Symbol Meaning Pseudocode it replaces
Oval Start or end (program begins or ends)
Parallelogram Input or output INPUT hours, OUTPUT fee
Rectangle Process SET fee = 2
Diamond Decision IF hours <= 1

Arrows carry the flow from one symbol to the next. Every symbol except the end oval has an arrow leaving it.

Worked example: a parking fee

A car park charges RM2 for the first hour or part of it, and RM1 for each extra hour. Input is the whole number of hours parked, and output is the fee.

Build the flowchart in this order:

  1. Oval: Start.
  2. Parallelogram: INPUT hours.
  3. Diamond: hours <= 1?
  4. Yes branch, rectangle: SET fee = 2.
  5. No branch, rectangle: SET fee = 2 + (hours − 1) × 1.
  6. Both branches join at a parallelogram: OUTPUT fee.
  7. Oval: End.

Test it with 4 hours. The diamond asks 4 <= 1, which is false, so the No branch runs: fee = 2 + 3 × 1 = RM5. With 1 hour the Yes branch gives RM2.

What is the most common flowchart mistake?

A common slip is to draw the diamond, follow the Yes arrow and forget the No arrow.

Drawing Problem
Diamond with only a Yes exit Inputs that fail the test go nowhere
Diamond with both exits labelled and joined Every input reaches the end

A quick check is to pick one input for each branch and follow the arrows with your pencil. If the pencil gets stuck, a path is missing.

Check yourself

Describe a flowchart that reads a mark and outputs “Grade A” if the mark is 80 or more, otherwise “Not A”. Which symbols are needed, and what is the output for 79?

Answer

Use an oval for Start, a parallelogram for INPUT mark, a diamond for mark >= 80?, two parallelograms for the two outputs, and an oval for End. The Yes exit goes to “Grade A”, the No exit goes to “Not A”, and both lead to End.

For 79, 79 >= 80 is false, so the output is Not A.

What to study next

Next, learn how to test that your design handles every kind of input in testing normal, boundary and invalid inputs. Use the restricted pseudocode trace trainer to trace the pseudocode version of your flowchart.

If you would like a teacher to check your diagrams, see online one-to-one Computer Science tuition.

Common questions

Which flowchart symbols do I need to know?

Four symbols are enough for these questions: an oval for start and end, a parallelogram for input and output, a rectangle for a process such as a calculation, and a diamond for a decision. Arrows show the direction of flow.

How many exits does a decision diamond have?

Two for a yes or no question, each labelled. Both paths must lead somewhere, and normally they join again before the end. A diamond with one exit is an incomplete flowchart.

How do I show a loop in a flowchart?

Use a decision diamond and an arrow that returns to an earlier step. The condition in the diamond decides whether to repeat or move on, so the return arrow is what makes it a loop.

Should the flowchart match the pseudocode exactly?

It should describe the same steps in the same order. Each pseudocode statement maps to one symbol, so you can check the two against each other line by line.

If your flowcharts lose a branch when a problem has two outcomes, a one-to-one Computer Science teacher can look at your diagrams and show where the path is missing.

  • Online one-to-one lessons for your child with an experienced teacher.
  • Your first class is a one-hour trial, from RM50. The fee is agreed before you book.
  • Happy with the teacher? Continue with lessons of about 1.5 hours. If not, ask for another teacher.