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

Loops and Repetition

שאלות 10

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

  1. רב־ברירהמדעי המחשבשפות תכנותrepetitionloop purposeprogramming concepts

    Purpose of a Loop

    A programmer wants a computer to clap its hands 10 times. Which programming idea lets the programmer write the clap instruction only once while still getting 10 claps?

    1. A variable

    2. A function name

    3. A comment

    4. A loop


    Think about an idea that makes the computer go back and do the same instructions again and again.
  2. רב־ברירהמדעי המחשבשפות תכנותrepeat blockstracing codeloop counting

    Counting Repetitions

    Look at this simple program written in a loop style:

    repeat 4 times:
    print "Hello"

    How many times will the word Hello be printed?

    1. 4

    2. 3

    3. 5

    4. 8


    Count how many times the program is told to repeat the instruction inside the loop.
  3. רב־ברירהמדעי המחשבשפות תכנותconditionswhile loopsloop terminationiteration

    When a While Loop Stops

    A program uses a while loop that keeps running as long as a light is switched on. What causes the loop to stop repeating?

    1. The loop body has a comment added

    2. The condition becomes false

    3. The computer is restarted by a user only

    4. The loop starts running


    A while loop checks a question before each repeat. Think about what happens when that question no longer says yes.
  4. רב־ברירהמדעי המחשבשפות תכנותtracing codeadditionaccumulatorloop variables

    Tracing a Loop with a Total

    A program starts with total = 0. It then uses a loop that goes through the numbers 1, 2, 3, and 4, and each time adds the current number to total. What is the value of total at the end?

    1. 12

    2. 10

    3. 8

    4. 7


    Add the numbers one at a time in the order the loop visits them: 1, then 2, then 3, then 4.
  5. נכון / לא נכוןמדעי המחשבשפות תכנותiterationprogramming vocabularyloop terminology

    Meaning of one loop repeat

    In programming, each time a loop goes around and runs its instructions once more is called one iteration.

    1. True

    2. False


    Think about the word 'iteration' as one single pass through the loop's instructions.
  6. נכון / לא נכוןמדעי המחשבloopsinfinite loop

    Infinite loops

    An infinite loop is a loop that stops after exactly one repeat.

    1. True

    2. False


    Consider what the word 'infinite' suggests about how long the loop keeps running.
  7. השלמהמדעי המחשבloopsfor loop

    Loop that runs a set number of times

    A loop that repeats a known number of times, such as counting from 1 to 5, is often called a _______ loop.


    Think of the word a programmer uses when saying 'do this for each number from 1 to 5.'
  8. השלמהמדעי המחשבloopscounter variable

    Tracking how many times a loop has run

    Inside a loop, a variable that keeps track of how many times the loop has already run is called a ___________.


    This variable goes up by one each time the loop goes around, like a score that counts repeats.
  9. שאלה פתוחהמדעי המחשבloopssequencesturtle graphics

    Drawing a shape with a loop

    A student writes this program to move a turtle on the screen:

    repeat 4 times:
    move forward 50 steps
    turn right 90 degrees

    What shape does the turtle draw?


    Think about how many sides the drawing has, and what kind of corners the turtle makes each time it turns 90 degrees.
  10. שאלה פתוחהמדעי המחשבloopsvariablestracing code

    Tracing a loop that doubles a number

    A program does the following:

    set x to 1
    repeat 3 times:
    set x to x × 2
    print x

    What number is printed?


    Follow the value of x step by step. Write down its value after each time the loop runs.

פרטים

A short quiz on repeating steps in simple programs, with questions about loops and their order.
קהל יעד
בית ספר יסודי · כיתות ד׳–ה׳
רמת קושי
4 מתוך 10
שפה
אנגלית
מי יכול לראות
כולם
הושלם על ידי AI
מה שמסומן בניצוץ נוסף על ידי AI.
נוצר באמצעות AI
Claude Haiku 5.5
נוצר

תגובות

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