דילוג לתוכן
מבחן 10 שאלות

Loops and Conditions in Robot Programs

שאלות 10

מפתח התשובות מוצג למורים מחוברים.

  1. רב־ברירהשפות תכנותloopsrobot programmingrepetition

    Purpose of a loop

    What is the main purpose of a loop in a robot program?

    1. To connect the robot to a Wi-Fi network

    2. To make the robot stop the program immediately

    3. To repeat a set of instructions

    4. To store sensor readings permanently


    Think about what happens when a robot needs to do the same movement many times.
  2. רב־ברירהשפות תכנותif blockconditionsrobot programming

    Role of an if block

    In a robot program, what does an 'if' block check?

    1. The length of the program file

    2. Whether a condition is true or false

    3. The color of the robot's body

    4. The total number of motors connected


    An 'if' block decides whether certain instructions run, based on a yes or no question.
  3. רב־ברירהשפות תכנותloopsrobot programmingrepeat block

    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?

    1. A variable block

    2. A wait block

    3. A single turn block

    4. A repeat block set to 4


    Look for the block that runs a group of instructions a fixed number of times.
  4. רב־ברירהשפות תכנותforever looprobot programminginfinite loops

    Endless loop

    Which type of loop keeps running its instructions until the program is stopped by the user or the power is turned off?

    1. A wait 2 seconds block

    2. An if-else block

    3. A forever loop

    4. A repeat 3 times loop


    This loop has no fixed number of repetitions; it has no natural end point of its own.
  5. רב־ברירהשפות תכנותif-elseconditionalslight sensor

    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?

    1. A counter variable

    2. A repeat 10 times loop

    3. An if-else structure

    4. A single move forward block


    The robot must choose one of two different paths depending on what the sensor reads.
  6. רב־ברירהתוכנהשפות תכנותsensorstouch sensorrepeat untilrobot blocks

    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?

    1. A repeat 10 times loop

    2. A repeat until touch sensor is pressed loop

    3. A wait 5 seconds block

    4. A turn 90 degrees block


    The number of repetitions is not known in advance; it depends on what the robot senses.
  7. רב־ברירהתוכנהשפות תכנותnested loopsloop executioncontrol flow

    Nested loops

    What happens when one loop is placed completely inside another loop in a robot program?

    1. The outer loop is skipped completely

    2. The inner loop runs fully for every repetition of the outer loop

    3. The inner loop runs only once in the whole program

    4. 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.
  8. רב־ברירהתוכנהשפות תכנותconditionssensorsdistance checkprogram logic

    Identifying a condition

    Which of the following is a condition that a robot program can check, rather than an action the robot performs?

    1. Turn left 90 degrees

    2. Move forward 20 cm

    3. Distance to the obstacle is less than 10 cm

    4. Play a sound


    A condition is a statement that can only be true or false, not something the robot does.
  9. רב־ברירהתוכנהשפות תכנותloopsrepeat blocksrobot movementdistance calculation

    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?

    1. 50 cm

    2. 5 cm

    3. 15 cm

    4. 10 cm


    Multiply the distance of one movement by the number of times the loop repeats.
  10. רב־ברירהתוכנהשפות תכנותwhile loopconditionsloop concepts

    Meaning of a while loop

    Which description best fits a 'while' loop in robot programming?

    1. It repeats its instructions as long as a given condition remains true

    2. It deletes all the instructions inside it

    3. It repeats exactly once and then ends

    4. It runs only when the robot is turned off


    The word 'while' describes continuing for as long as something is the case.

פרטים

The exam covers repeat loops, if-else conditions and simple sequences of commands that control a robot, with questions on reading and predicting a program's behaviour.
מקצועות
שפות תכנות
קהל יעד
חטיבת ביניים · כיתות ז׳–ט׳
רמת קושי
5 מתוך 10
שפה
אנגלית
מי יכול לראות
כולם
הושלם על ידי AI
מה שמסומן בניצוץ נוסף על ידי AI.
נוצר באמצעות AI
Claude Haiku 5.5
נוצר

תגובות

  1. אין תגובות עדיין.
© כל הזכויות שמורות