Grade 12 results are out. Where to check yours

Grade 10 Information Technology unit 6

Algorithms: clear steps and loops that end

4 min · 2 past exam questions worked through

Parts of the lesson

Tap a part to play the lesson from there.

A 4-minute Temari video lesson on Grade 10 Information Technology unit 6: Algorithms: clear steps and loops that end. Free to watch, no account needed.

More on unit 6

The chapter's own page holds the rest of what Temari has on it, such as short notes and practice questions with their answers.

Open the unit 6 page

Everything the lesson says

The lesson's words, part by part. Tap a time to play the lesson from there.

0:00Introduction

A computer does only what it is told. So before anyone writes a program, they plan an algorithm: the steps that solve the problem. Learn what makes a good algorithm, and how a loop repeats its steps and then stops.

0:15What an algorithm is

An algorithm is a precise method of solving a problem. It is a sequence of step-by-step instructions, and each step is unambiguous. That means it can be read in only one way. Think of a new recipe, like doro wot. You follow its steps one by one, in order, and the dish comes out right.

Every algorithm is described by three activities: input, process and output. Take adding two numbers. Steps one and two take the two numbers from the user. That is the input. Step three adds them. That is the process. Step four displays the sum. That is the output.

0:57Six characteristics

Not every list of instructions is an algorithm. Your book names six characteristics it must have. First, it is clear and unambiguous. Every step has only one meaning. Second, its inputs are well defined. Third, its outputs are well defined too. You know exactly what it gives back.

Fourth, finiteness. The algorithm must end. It must never get stuck in an infinite loop, a loop that repeats forever. Fifth, it is feasible: simple and practical, so it can run on the resources you have. And sixth, it is language independent. The same plain steps can be written in any programming language, and the output is the same.

1:45Practice question 1Past exam

Here is a practice question. Which characteristic of an algorithm states that it must terminate and not run endlessly in an infinite loop? Pause the video, and try it.

Terminate means end. An algorithm that ends after a finite number of steps has finiteness. The answer is C. Feasibility is about being practical with the resources you have. Language independence means any language will do. And unambiguity means every step has only one meaning. None of those is about stopping.

2:26The four parts of a loop

Finiteness matters most in a loop. A loop is a set of instructions that repeats until some condition is met. Your book adds up the first fifty natural numbers with one: one plus two plus three, all the way to fifty. A loop has four parts.

First, initialization. It sets the starting values: the sum is zero, and the counter is one. Second, computation. This is the processing: add the counter to the sum. Third, the test. Has the counter reached fifty? If it has, the loop ends. Every loop needs this way out, or it runs forever. Fourth, the increment. Add one to the counter, ready for the next pass.

3:13Practice question 2Past exam

Try this one. In a loop structure, which part represents the actual processing step? Pause, and try it.

Your book says it in one word: computation is processing. In our loop, it is the step that adds the counter to the sum. The answer is B. Initialization only sets the starting values. The test decides when to leave. And the increment gets the counter ready for the next pass.

3:48Summary

So remember. An algorithm is precise, step-by-step instructions, described by input, process and output. It must have finiteness: it has to end. And a loop has four parts: initialization, computation, test and increment, where computation is the processing. Keep practising questions like these on Temari.et.

Practise this unit in the app

Temari turns this chapter into timed practice and marks it as you go, with an AI tutor to explain anything that did not land.

Start free

Temari.et is also an Android app, free on Google Play.

Sign inCreate your account