The ____ control structure is used when a ____ of code needs to be executed a certain number of times. ____ provides two types of repetition structures; the ‘while’ and ‘for ____. Both loops perform the same function: to check whether a certain ____ is true or not. If the condition is true, the program will execute the instruction(s) inside the loop repeatedly; until the condition is no longer ____. When that happens, the program will skip the loop and will start executing the code that comes after it While-loopThe while-____ checks the control variable condition continuously. If the condition is ____, then the code between the curly braces ({...}) is executed sequentially. Once the ____ is done executing the instructions inside the while-loop, it returns to the top of the loop and checks the condition again. If the condition is still true, the ____ executes again. The process will repeat until the while-loop expression/condition becomes ____. When that happens, the program will skip the while-loop and will execute the code that comes after it initialise the control ________() { set pin#12 as output //red LED set pin#7 as output //blue LED while (control variable) { turn red LED ON wait 0.5s (500ms) turn red LED OFF wait 0.5s (____) i=i+1 } turn red LED OFF turn blue LED ON } ____() { } For-loopThe for-loop performs exactly like the while-loop, in the sense that it ____ whether a certain condition is true or not. If the condition is true, then the program will run the loop’s block of code ____. When the condition is no longer true, the program will ____ the instructions inside the loop and will start executing the code that comes after it. However, the code ____ for the for-loop is different than that of the while-loop. The for-loop has three arguments; the initialisation of the loop’s control ____, the loop-continuation condition, and the control variable expression. ____() {set pin____12 as output // LED } ____() { for (initialise the control ____ i; i<3; increment i ) { turn LED ON wait 200ms turn LED OFF wait 200ms i=i+1 } turn LED OFF ____ 5s ____
0%
Repetition control structure
共用
共用
共用
由
Decred18
編輯內容
列印
嵌入
更多
作業
排行榜
顯示更多
顯示更少
此排行榜當前是私有的。單擊
共用
使其公開。
資源擁有者已禁用此排行榜。
此排行榜被禁用,因為您的選項與資源擁有者不同。
還原選項
完成句子
是一個開放式範本。它不會為排行榜生成分數。
需要登錄
視覺風格
字體
需要訂閱
選項
切換範本
顯示所有
播放活動時將顯示更多格式。
打開結果
複製連結
QR 代碼
刪除
恢復自動保存:
?