Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1if distance < 30: beep() | Adistance = proximity_sensor.read() | |
| 2if object_near: screen_off() | Bif person_near: open_door() | |
| 3A proximity sensor on an automatic door detects a person nearby without touching them, so the door opens | CAn automatic door uses a proximity sensor, so the condition should test whether a person is near (person_near), not read a temperature value. | |
| 4A parking sensor captures the distance to an object, so the data can be a number, not just near or not near | DReads the proximity sensor's distance value and sounds a warning when an object is closer than 30 cm, like a parking sensor | |
| 5if touched: screen_off() | ETurns the phone screen off when the proximity sensor detects the phone is held against the face during a call | |
| 6if temperature > 30: open_door() | FA proximity sensor detects an object nearby WITHOUT touching it, so the condition should check for a nearby object (for example object_near), not a touch. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
proximity sensor — A sensor that detects whether an object is nearby, or how far away it is, without touching it. Used in parking sensors, phones turning off the screen during calls and automatic doors.distance ← ProximitySensor()IF distance < 50 THEN
OUTPUT "Beep"
ENDIFIF onCall = TRUE AND near = TRUE THEN
ScreenOff()
ENDIFIF objectNear = TRUE THEN
OpenDoor()
ENDIFdistance ← ProximitySensor()
IF distance <= 30 THEN OUTPUT "Stop" ENDIF