Algorithms · GCSE · OCR J277 2.1.2, AQA 8525 3.1.1, Edexcel 1CP2 1.2.1 · about 12 min
Inputs, processes and outputs; what makes an algorithm precise; programs implement algorithms.
[1 mark]What is an algorithm?
[1 mark]"Drive towards the wall and stop when close." What is wrong with this as an algorithm?
[1 mark]A program asks for a number of sides, works out the angle and drives the shape. Which are inputs?
Tick every answer that is true.
[1 mark]What does it mean for an algorithm to be finite?
[1 mark]In which forms can an algorithm be written?
Tick every answer that is true.
Turn the shape algorithm into a program. Ask How many sides? , work out the corner angle, drive the shape with 20 cm sides, and print drew a shape with <n> sides. The task answers 5. Work the angle out; do not type it.
# the two lines every program starts with: the commands, then the robot from bugbot import * connect() # 1. Ask how many sides. # 2. Work out the angle. # 3. Repeat for each side: drive 20 cm, turn. # 4. Say how many sides were drawn.
Plan your program here, then type it in and press Run.