Loops and Conditions in Robot Programs
שאלות 10
מפתח התשובות מוצג למורים מחוברים.
-
Purpose of a loop
What is the main purpose of a loop in a robot program?
To connect the robot to a Wi-Fi network
To make the robot stop the program immediately
To repeat a set of instructions
To store sensor readings permanently
Think about what happens when a robot needs to do the same movement many times. -
-
Drawing a square
A robot must move forward and turn right four times in order to drive around the edges of a square. Which block is the most suitable to avoid writing the same instructions four times?
A variable block
A wait block
A single turn block
A repeat block set to 4
Look for the block that runs a group of instructions a fixed number of times. -
-
Choosing between two actions
A robot should turn left if its light sensor reads dark, and otherwise it should keep going straight. Which programming structure fits this situation best?
A counter variable
A repeat 10 times loop
An if-else structure
A single move forward block
The robot must choose one of two different paths depending on what the sensor reads. -
Moving until a sensor is triggered
A robot should keep moving forward until its touch sensor is pressed by a wall. Which block is the most appropriate for this task?
A repeat 10 times loop
A repeat until touch sensor is pressed loop
A wait 5 seconds block
A turn 90 degrees block
The number of repetitions is not known in advance; it depends on what the robot senses. -
Nested loops
What happens when one loop is placed completely inside another loop in a robot program?
The outer loop is skipped completely
The inner loop runs fully for every repetition of the outer loop
The inner loop runs only once in the whole program
The program stops after the first repetition
Imagine a loop of loops: each time the outer loop goes around once, the inner loop starts again from the beginning. -
Identifying a condition
Which of the following is a condition that a robot program can check, rather than an action the robot performs?
Turn left 90 degrees
Move forward 20 cm
Distance to the obstacle is less than 10 cm
Play a sound
A condition is a statement that can only be true or false, not something the robot does. -
Counting distance in a loop
A program contains a loop set to repeat 5 times, and inside the loop is a block that makes the robot move forward 10 cm. How far does the robot travel in total, assuming nothing else in the program moves it?
50 cm
5 cm
15 cm
10 cm
Multiply the distance of one movement by the number of times the loop repeats. -
Meaning of a while loop
Which description best fits a 'while' loop in robot programming?
It repeats its instructions as long as a given condition remains true
It deletes all the instructions inside it
It repeats exactly once and then ends
It runs only when the robot is turned off
The word 'while' describes continuing for as long as something is the case.
פרטים
- מקצועות
- שפות תכנות
- קהל יעד
- חטיבת ביניים · כיתות ז׳–ט׳
- רמת קושי
- 5 מתוך 10
- שפה
- אנגלית
- מי יכול לראות
- כולם
- הושלם על ידי AI
- מה שמסומן בניצוץ נוסף על ידי AI.
- נוצר באמצעות AI
- Claude Haiku 5.5
- נוצר
תגובות