Loops and Repetition
שאלות 10
מפתח התשובות מוצג למורים מחוברים.
-
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?
A variable
A function name
A comment
A loop
Think about an idea that makes the computer go back and do the same instructions again and again. -
-
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?
The loop body has a comment added
The condition becomes false
The computer is restarted by a user only
The loop starts running
A while loop checks a question before each repeat. Think about what happens when that question no longer says yes. -
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?
12
10
8
7
Add the numbers one at a time in the order the loop visits them: 1, then 2, then 3, then 4. -
-
-
-
-
-
פרטים
- מקצועות
- מדעי המחשב נוסף על ידי AI שפות תכנות
- תגיות
- נוסף על ידי AI loops נוסף על ידי AI turtle graphics נוסף על ידי AI repetition נוסף על ידי AI for loops נוסף על ידי AI counters
- קהל יעד
- בית ספר יסודי · כיתות ד׳–ה׳
- רמת קושי
- 4 מתוך 10
- שפה
- אנגלית
- מי יכול לראות
- כולם
- הושלם על ידי AI
- מה שמסומן בניצוץ נוסף על ידי AI.
- נוצר באמצעות AI
- Claude Haiku 5.5
- נוצר
תגובות