7

Lesson 7 of 20 ยท Simple Algorithms

Simple Algorithms โ€” Part 15

Design a step-by-step plan to solve a problem. This is part 15 of 20.

What you'll learn

You will learn that an algorithm is a reusable set of steps that solves a problem for any input.

Steps

  1. 1An algorithm is a set of clear steps to solve a problem. Here the problem is: double a number. The steps: take n, multiply by 2, show result.
  2. 2If n is 4, then result = 4 * 2 = 8. The output would be 'Start: 4' then 'Double: 8'.
  3. 3The beauty of an algorithm: change n to 6, and the same steps give 'Double: 12'. Same recipe, different ingredients!
  4. 4Algorithms are everywhere: a recipe is an algorithm for cooking, turn-by-turn directions are an algorithm for driving. Code is algorithms for computers!

Key Terms

Algorithm
A clear set of steps that solve a problem. Same steps work for different inputs.
Input
The data you give to the program (e.g. the number n).
Result
What the program produces after following the steps.
Python 3
Output
Loading Python... This may take a few seconds.

Your code runs only in your browser. No code is sent to any server. Stay safe and have fun learning!

๐Ÿ–จ๏ธ

Checkout complete lesson on Simple Algorithms for 5th Grade

Get the full Simple Algorithms track as a printable PDF โ€” all lessons, worksheets, and answer keys.

View in Shop

Your Cart (0)

Your cart is empty

Browse our shop to find activities your kids will love