£199.99 £139.99 for one year of Unlimited learning. Offer ends on 14 November 2022 at 23:59 (UTC). T&Cs apply

Find out more
Pseudo code: step-by-step
Skip main navigation

Pseudo code: step-by-step

Pseudo code: step-by-step. Flow charts
© Coventry University. CC BY-NC 4.0
Programming is just telling a computer what you want it to do, however, this is not as easy as it sounds.

To be able to talk to a computer we need to talk in a language that it understands. We can’t just walk up to it and say, ‘make a cup of tea’, as it will just ask us, ‘what is tea?’ We need to break down each step, define each ingredient and explain every method.

Imagine a scenario where the year is 2021, Earth has made first contact with aliens and you have been chosen to ‘teach them how to make a cup of tea’ (the British way).

To you, this task may seem trivial, but to the alien, the idea of tea is completely foreign. They have no concept of tea, milk, sugar, kettles, electricity and will have no idea what you are trying to explain to them. So what steps do we take first?

Defining your programs intentions and steps

First, we need to decide why we are trying to tell the computer to do something. For our program (or alien tea tutorial) we need to be defining the program’s purpose. For this scenario ours will be ‘to make the user a cup of tea’.

Next, we need break down our program to the absolute basic steps and questions that the computer can understand and, therefore, create the desired output. One method of doing this is converting our instructions into pseudo code. This is a way of informally laying out the design of the program without doing any actual programming. Pseudo code acts as a bridge between plain English and programming code, making it easy for humans to interpret. It’s best to do this in the early stages of the design.

For our tea-making example, the pseudo code would look something like the following:

  1. Put the tea bag in mug
  2. Add water
  3. Add milk
  4. Add sugar
  5. Serve

Your task

Now consider you’re teaching the alien how to make a cappuccino (the barista way); a slightly more complex process.
Identify the steps you would write into the pseudo code and post your design in the comments area below.
© Coventry University. CC BY-NC 4.0
This article is from the free online

Get ready for a Masters in Data Science and AI

Created by
FutureLearn - Learning For Life

Our purpose is to transform access to education.

We offer a diverse selection of courses from leading universities and cultural institutions from around the world. These are delivered one step at a time, and are accessible on mobile, tablet and desktop, so you can fit learning around your life.

We believe learning should be an enjoyable, social experience, so our courses offer the opportunity to discuss what you’re learning with others as you go, helping you make fresh discoveries and form new ideas.
You can unlock new opportunities with unlimited access to hundreds of online short courses for a year by subscribing to our Unlimited package. Build your knowledge with top universities and organisations.

Learn more about how FutureLearn is transforming access to education