Lesson Notes By Weeks and Term v4 - JHS 2

ALGORITHM

Download the Lessonotes Mobile Ghana app for faster lesson access on Android and iPhone.

Subject: Computing

Class: JHS 2

Term: 3rd Term

Week: 8

Grade code: B8.4.2.1.1

Strand code: 4

Sub-strand code: 2

Content standard code: B8.4.2.1

Indicator code: B8.4.2.1.1

Theme: COMPUTATIONAL THINKING

Subtheme: ALGORITHM

Lesson Video

This page supports the lesson note with a companion video and a short classroom-ready summary.

For class groups and homework, share this lesson page so learners also get the summary, objectives, and full lesson context.

Performance objectives

Lesson summary

This lesson introduces the fundamental building blocks of how computers perform calculations within an algorithm. An algorithm is just a set of step-by-step instructions to solve a problem. Think about how you calculate the total cost of items at the market or how mobile money calculates your transaction fee—these are all algorithms at work! Today, we will learn how computers use variables (to store information), expressions (to do the maths), and assignment statements (to save the answers). Most importantly, we will learn the specific order, known as BODMAS, that computers follow to avoid making mistakes, ensuring that `2 + 3 * 4` gives the correct answer every time.

Lesson notes

What is an Algorithm? An algorithm is a clear, step-by-step list of instructions to complete a task or solve a problem. For example, a recipe for preparing jollof rice is an algorithm. In computing, we write algorithms to tell the computer exactly what to do.

To perform calculations, our algorithms need three key tools:

a) Variables A variable is like a labelled box or container in the computer's memory where we can store a piece of information that might change. We give it a name so we can refer to it later. Analogy: Imagine you have a box labelled `MyAge`. You can put the number `14` inside it. Next year, you can take out `14` and put `15` inside. The box (`MyAge`) is the variable, and the number inside (`14` or `15`) is its value. Ghanaian Examples: `priceOfKenkey = 5` (Here, `priceOfKenkey` is the variable name, and `5` is the value). `numberOfStudents = 42` `momoBalance = 150.75`

b) Assignment Statements An assignment statement is the instruction that puts a value *into* a variable. In computing, we use the equals sign (`=`) for assignment. How to read it: When you see `x = 10`, you should read it as "x is assigned the value 10" or "x gets 10". It is not saying that x is mathematically equal to 10; it is an action of storing a value. Examples: `myAge = 14` (The variable `myAge` now holds the value `14`). `totalCost = priceOfBook + priceOfPen` (The variable `totalCost` gets the result of adding the values stored in `priceOfBook` and `priceOfPen`).

Evaluation guide