An algorithm is a set of instructions that completes a tasks.
We use algorithms all the time, in all parts of our life such as, following recipes, building Lego models, assembling flat-pack furniture or following sat-nav directions.
When creating programs (stored sets of instructions for a computer to follow) it helps to plan your program first, and is essential in bigger programs.
If you don’t plan, you might forget important steps, mix things up, or waste time. But if you plan, you know what to do, when to do it, and how everything fits together. It helps the program work properly and saves time fixing mistakes later.
Below is an example of the paln that was used to create a program that draws polygons.
Follow the plan to create the above program.
You are going to create a guessing game.
Maths Man should think of a random number between 1 and 100 and store it in a variable.
Maths Man will then ask you to guess what the number is.
Maths man should count each time you make a guess.
Maths Man should then tell you if your guess is too big, or too small.
If you didn’t guess correctly, Maths Man should then ask you to guess again.
If you guessed correctly, Maths Man should say well done, then tell you how many guesses it took.
Create a plan using the blank planning sheet for the "Think of a Number" game.
Create a program the program so it works as described above by following your plan.