5.9.5 Extend Vote For Me

Question: Why do we use while loops in JavaScript?

Answer: To repeat some code while a condition is true

Question: Which general while loop definition is written correctly?

Answer: D

Question: 5.1.3: Move to Wall

Answer: function start(){

while(frontIsClear()){

move();

}

}

Question: 5.1.4: Follow The Yellow Ball Road

Answer: // Follow the yellow ball road!

// Karel moves until it’s not on a tennis ball.

function start() {

while(ballsPresent()){

move();

}

}

Question: 5.1.5: Lay Row of Tennis Balls

Answer: /* Write a program to lay a row of tennis balls

* across first street. Make sure to test your

/

function start(){

while(noBallsPresent()){

putBall();

if (frontIsClear()){

move();

}

}

}

Donation Page

Support Our Work

Do you appreciate the value this website provides? If so, please consider donating to help keep it running. Your donation will go a long way in helping us continue to provide the same quality of content and services. Every bit helps, and your support is greatly appreciated. Thank you for your generosity.