Flowcharts and Pseudocode
A coding lesson for ages 7-10: learn how flowcharts and pseudocode help you plan a program before you code it, with shapes, arrows, examples and a fun quiz.
Key takeaways
- A flowchart is a picture of the steps in a plan, drawn with boxes and arrows
- Different flowchart shapes mean different things, like start, action, or a question
- Pseudocode is a plan written in plain words instead of real code
- Planning first makes the real coding much easier
A plan before you build
Before builders make a house, they draw a plan. Before you code a program, it helps to make a plan too. Two great planning tools are the flowchart and pseudocode. They help you think about the steps before you start typing.
This is part of what coders call planning an algorithm β a clear list of steps to do a job. Flowcharts and pseudocode are just two ways to write that plan down.
What is a flowchart?
A flowchart is a picture of your steps. You draw boxes for each step and join them with arrows. You follow the arrows from the top to the bottom, just like following a path.
The clever part is that flowcharts use different shapes for different jobs:
- π’ Oval β the start or the end.
- β Rectangle β an action, like "pour the milk."
- π· Diamond β a question with a yes or no answer.
- β‘οΈ Arrow β shows which step comes next.
A flowchart for making toast
Let's draw the steps for making toast as a flowchart:
- Start (oval)
- Put bread in the toaster (rectangle)
- Turn the toaster on (rectangle)
- Is the toast brown? (diamond)
- No β wait a bit, then ask again
- Yes β go to the next step
- Take the toast out (rectangle)
- End (oval)
See the diamond? It asks a question. If the answer is "no," the arrow loops back so we keep waiting. If the answer is "yes," we move on. That loop is how a flowchart shows "keep doing this until it is ready."
What is pseudocode?
Pseudocode is a plan written in plain words instead of real code. The word looks tricky, but "pseudo" just means "pretend." So pseudocode is pretend code β it looks a little like a program, but anyone can read it.
Here is the toast plan written as pseudocode:
START
Put bread in the toaster
Turn the toaster on
REPEAT until toast is brown:
Wait a little
Take the toast out
END
No special computer words are needed. You just write the steps clearly, one per line, in the right order. Later, you can turn each line into real code.
Flowchart or pseudocode?
You might wonder which one to use. The good news is that they do the same job β they both write down your plan before you code. They just look different:
- π A flowchart is a picture. It is great when you want to see the path your steps take, especially when there are questions and loops. Many people find pictures easier to follow.
- βοΈ Pseudocode is words. It is quick to write and looks more like the real code you will type later, so it is easy to turn into a program.
Some coders sketch a flowchart first to get the big picture, then write pseudocode to fill in the details. Others pick just one. There is no single right answer β use whichever helps you think most clearly.
Why planning helps
Imagine trying to build a model rocket with no instructions. You might glue the wrong pieces together! Coding is the same. If you plan first with a flowchart or pseudocode, you spot problems early. You can also share your plan with a friend, and they can read it even if they don't know how to code.
When your plan is clear, the real coding becomes much easier β and you make fewer mistakes. And when mistakes do happen, planning helps you find them faster, which is the heart of debugging.
Try it yourself
Pick something you do every day, like getting ready for school or feeding a pet. Then:
- π Write it as pseudocode β list each step in plain words, one per line.
- π· Draw it as a flowchart β use rectangles for actions and a diamond for any question (like "Is the bowl empty?").
- π Try adding a loop, such as "keep brushing until your teeth are clean."
Swap with a friend and follow each other's plans exactly. If a step is missing or in the wrong place, you'll find out fast β and that is exactly what good planning is for!
Quick quiz
Test yourself and earn XP
What is a flowchart?
A flowchart uses boxes and arrows to show the steps of a plan, one after another.
What shape is used for a question in a flowchart?
A diamond shape holds a yes/no question, and the arrows show what to do for each answer.
What is pseudocode?
Pseudocode is a way to write out your plan using normal words instead of real code.
Why do we plan before we code?
Planning helps you think through the steps so the coding goes smoothly.
FAQ
No. You can draw a flowchart on paper with a pencil, or even with sticky notes. The point is to plan your steps before you type any code.
No. Pseudocode is meant to be easy for people to read, so you can use your own plain words. As long as the steps are clear and in the right order, it works.
Keep exploring
More in Coding