DoRevision

Programming Concepts: Algorithms and Data

What an algorithm is, planning one with pseudocode or a flowchart, computational thinking, variables, and the common data types used in a program.

⏱️ 20 min 🎯 15 activities
Best used for
Intervention Mock preparation Cover lesson

Justify the choices, the way you are assessed

Free interactive practice on the decisions the assessment actually asks you to justify.

Start revising free

What you'll cover

Telling a computer exactly what to do

A computer only ever does what it is told, in the order it is told, so programming begins with a clear plan called an algorithm: a step-by-step set of instructions that solves a problem. Before writing any code, a programmer works out the algorithm and how the information will be stored. Information in a program is held in variables, and every value has a data type, such as a whole number or a piece of text, which tells the computer what it can do with it. This module covers what an algorithm is and how to plan one with pseudocode or a flowchart, the idea of breaking a problem down, and the common data types you use to store information. Getting these right is the foundation of every program.

Programming words

Learn these five terms before you plan a program.

Match each data type to what it holds

  • an integer
  • a real number
  • a Boolean
  • a character
  • a string
  • a whole number, such as 7
  • a number with a decimal point, such as 3.5
  • a value that is either true or false
  • a single letter or symbol
  • a piece of text, such as a name

Pseudocode against a flowchart

There are two common ways to plan an algorithm before you code it.

Which data type fits?

A program needs to store whether a light is on or off, with nothing in between. Which data type best fits?

  • A Boolean
  • An integer
  • A string
  • A real number

Think it through before you code

The hardest part of programming is not the typing; it is the thinking. Good programmers plan before they touch the keyboard. First they break a big problem into smaller parts, a skill called decomposition, so each part is small enough to solve. Then they work out the algorithm for each part, step by step, and decide what information they need to store and what type each value should be. Only then do they write the code. Planning like this means the logic is right before a single line is typed, so there is far less to fix later. When you are stuck, the answer is almost always to step back to the algorithm, not to type faster.

Pick the true facts about algorithms

Select every statement about algorithms and data that is true.

  • An algorithm is a step-by-step set of instructions to solve a problem
  • A variable stores a value that can change while the program runs
  • Pseudocode and flowcharts are two ways to plan an algorithm
  • A Boolean can store any word you like
  • An algorithm only works if written in one exact language

Order how to plan a program

Put the steps of planning a program in a sensible order.

  • Understand the problem
  • Break it into smaller parts
  • Work out the algorithm step by step
  • Choose the data types you need
  • Test the algorithm with example data

Complete the programming facts

A step-by-step set of instructions that solves a problem is an _____. A named store for a value that can change is a _____. A value that is either true or false is a _____. A piece of text such as a name is a _____.

algorithm variable Boolean string integer flowchart

A recipe as a set of steps

Think of a recipe for a bowl of soup. It lists the steps in order: chop the vegetables, boil the stock, add the vegetables, let it simmer, then serve. Follow those steps in that order and anyone gets the same soup, even someone who has never made it before. The recipe also has amounts that can change, like how much salt to add, and a simple yes-or-no check, like whether the pot has come to the boil yet. A set of instructions for a computer works in exactly the same way: clear steps in the right order, some values that can change along the way, and simple checks that decide what happens next. Get the steps right on paper first, and the cooking, or the coding, goes far more smoothly.

Tap the parts of an algorithm

Tap every item below that is a genuine part of an algorithm.

  • clear steps in order
  • values that can change
  • checks that decide what happens next
  • the colour of the computer case

The algorithm run

Answer each one correctly to keep your lives. Choose the best answer.

Choose the right approach

Read each situation and choose the best answer.

  • A problem feels too big to solve all at once. What should you do first?
  • You need to store the age of a person as a whole number. Which data type do you use?
  • Before writing any code, how should you set out the steps?

Build a programming point

Choose the word for each gap to complete one accurate point about programming.

Explain algorithms and data

A friend is starting to learn programming and does not understand algorithms or data types. Explain them clearly.

  • Explain what an algorithm is
  • Explain two ways to plan an algorithm
  • Explain what a variable is
  • Explain what a data type is, with examples
  • Explain why planning the algorithm first helps