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

Term 3 review

Week 30 · Review: Term 3 · 3 lessons
3

Review: robots, languages and plans

Computing 6: Units 9–12, pp. 124–177
GoalRecall analogue and digital data, binary, robot rules, block and text languages, prototypes and the stages of a project plan.
New words
digitise · to change analogue data, such as sound, into numbers a computer can storesensor · a part that measures something, such as light or distancesyntax · the spelling and punctuation rules of a programming languageprototype · a model of a program that users test before the final version is built
Explanation

The real world is analogue, so a computer digitises sound and light into numbers, which it keeps in binary. In four bits the places are worth 8, 4, 2 and 1, and we add up the places that hold a 1. A robot uses sensors, and its program has rules such as if the front is clear, move forward, else stop. A program can be made of blocks or typed in a text language such as Python. Text languages are strict about syntax, so a missing bracket or a misspelt word is an error. Before building a program, we can test a prototype with users. A project plan has five stages: requirements, design, implementation, testing and evaluation, and we go round them again to make a better version.

Place value8421
Example bits1010
Worth8020
Worked examples
Number8421
131101
70111
The bits in the picture above, 1010, are worth 8 + 0 + 2 + 0 = 10. To write 13, take the biggest place that fits, then the next: 13 = 8 + 4 + 1, so 13 is 1101.
Robot on squareFront
1clear
2clear
3wall
A cleaning robot follows one rule: if the square in front is clear, move forward, else stop. It starts on square 1. Squares 1 and 2 have a clear front and square 3 has a wall in front. The robot moves to square 2, then to square 3, and it stops there.
Python
1age = 11
2if age >= 12:
3    print("Senior")
4else:
5    print("Junior")
Output
Junior
This Python program has no errors. The value of age is 11. The test age >= 12 is false, so the else part runs and the program prints Junior.
StageFor the cleaning robot
Requirementsclean the window and stop at the edge
Designdraw the flowchart of the rule
Implementationwrite the program
Testingtry windows of different sizes
Evaluationdid it clean the whole window?
A project plan can be applied to a robot job. Each stage has its own question.
Class activity

Robot dance (no computer): one child is the robot and the others are programmers. Mark five squares on the floor and put a wall card after square 4. Write the rule on the board: if the square in front is clear, move forward, else stop. The robot follows the rule exactly. Then change the rule, for example turn left when the front is a wall, and play again. Finally, write the five project stages on cards and put them in order. Which stage would you do after the robot walks into the wall?

Practice
1
Write 14 in binary using four bits. Which places hold a 1?
Place value8421
Bits????
2
What does the program print? Change one line so that it prints many.
Python
1count = 2
2if count > 5:
3    print("many")
4else:
5    print("few")
3
A robot reads the squares ahead one at a time: clear, clear, dark, clear. Its rule is: if the reading is dark, turn left, else move forward. Write what the robot does.
Reading1234
Sensorclearcleardarkclear
4
Sort into analogue and digital: (a) a singer’s voice in the room, (b) the song saved on a tablet, (c) the light of the setting sun, (d) a number on a calculator. Which device turns the voice into numbers?