AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Term 2 review

Week 21 · Review: Term 2 · 3 lessons
3

Sheets and decisions

Computing 5: Units 5–8, pp. 58–118
GoalReview spreadsheet formulas, copying, validation and filters, and trace a micro:bit if … then … else program.
New words
formula · a calculation in a cell that starts with =cell reference · the column letter and row number of a cell, such as C3validation · a rule that limits what can be typed in a cellif … then … else · a statement that carries out exactly one of two paths
Explanation

A formula starts with = and uses cell references, so the answer updates when a value changes. The operators are +, -, * and /. SUM adds a range of cells and AVERAGE finds the mean. When we drag the fill handle, the formula is copied and its row numbers change. Validation limits what can be typed, such as the type, the length or the range. It cannot tell us that the data is true. A filter hides the rows that do not match a criterion. In a micro:bit program, an if … then … else block carries out exactly one of its two paths, depending on a true or false test such as lives = 0.

IdeaWhat to checkExample
formulastarts with = and uses cell references=B2*C2
fill handlerow numbers change in each copy=B3*C3 in the next row
validationlimits what may be typeda whole number from 1 to 60
filterhides rows that do not matchPrice greater than 3
if … then … elseexactly one path is carried outlives = 0
Worked examples
D3fx=B3*C3
ABCD
1DayTicketsPriceIncome
2Fri254100
3Sat404160
4Sun254100
A film club earns money each day. The formula in D3 is =B3*C3, which is 40 × 4 = 160. Dragging the fill handle from D2 gives the other rows.
B5fx=AVERAGE(B2:B4)
ABCD
1DayTicketsPriceIncome
2Fri254100
3Sat404160
4Sun254100
5Mean30
6Total360
A total and a mean for the same sheet. =SUM(D2:D4) adds 100 + 160 + 100 = 360. =AVERAGE(B2:B4) is (25 + 40 + 25) ÷ 3 = 30.
Livessetlivesto3on startLiveschangelivesby-1show stringEndshow numberlivesiflives=0thenelseon shake
A lives game. The board starts with 3 lives. Each shake takes 1 life away. When lives equals 0 it shows End. Until then it shows the number of lives. The three shakes show 2, 1 and End.
Class activity

Paper sheet and paper board (groups of four). Draw a grid with columns A to D and rows 1 to 5 on a big sheet. One child writes the formulas, one works out the answers, one checks with a calculator and one changes a value. Predict which cells change before the value is changed. Then act out the lives game: one child is the board and holds the lives card, and another claps for each shake. What happens if the board keeps going after End?

Practice
1
Write the formula for D2. What is the value in D2? If it is copied to D3, what is the formula and the value?
ABCD
1AnimalNumberFood each (g)Food (g)
2Rabbits540?
3Hamsters1215?
2
The cells B2 to B5 hold 8, 12, 5 and 7. What do =SUM(B2:B5) and =AVERAGE(B2:B5) give?
3
A fuel game starts with 4 fuel and the board is shaken 3 times. What does it show each time?
Fuelsetfuelto4on startFuelchangefuelby-2show stringEmptyshow numberfueliffuel=0thenelseon shake
4
A column for ticket numbers accepts only whole numbers from 1 to 60. Which of these are rejected? 0, 45, 61, 12.5