Font size
WorksheetsForloops Drill
Total questions: 7
Worksheet time: 5mins
What is the right way to write the function:
makePancakes (Clue: this pancake will be made by putting 3 balls)
function makePancakes(){
putBall();
putBall();
putBall();
}
function makePancakes()
putBall();
putBall();
putBall();
function makePancakes: {
putBall();
putBall();
putBall();
}
function makePancakes(){
putBall();
}
What is the symbol used for the INCREMENT operator in JS?
+
++
=
==
for(let i = 1; i < 6; i++){
putBall();
How many times will a ball be placed?
5
6
7
8
Why do we use a for loop in programming
Easier to read
It's more efficient
To repeat an action a number of times
It helps with sequencing
Which code is correct? Karel starts at 0,0.
for(let i = 0; i < 4; i++){
move();
}
putBall();
for(let i = 0; i < 2; i++){
move();
}
putBall();
for(let i = 0; i < 3; i++){
move();
}
putBall();
which code is correct? Karel starts at 0,0
for(let i = 0; i < 2; i++){
move();
turnLeft();
move();
}
putBall();
for(let i = 0; i < 3; i++){
move();
turnLeft();
move();
}
putBall();
for(let i = 0; i < 1; i++){
move();
turnLeft();
move();
}
putBall();
