For loops in Javascript are written and executed in the same manner as the Karel exercises. However, now we explore in more detail the other parts of the loop besides using it as just a counter. We can modify the initialization statement, test statement, and increment statement. The caterpillar problem is one of the more challenging problems because it has students combine several concepts. You will probably spend a week on for loops.


Students will be able to…
* Create for loops in JavaScript
* Explain the purpose of for loops
* Utilize for loops to avoid typing out repeated code
* Use the loop counter i inside the for loop code to do something different on each iteration


These are all the activities included in the lesson.


4.5.1 Basic For Loop


4.5.2 For Loops Quiz


4.5.3 For Loop


4.5.4 Chalkboard

Exercise SHOW ME

4.5.5 The Worm

Exercise SHOW ME

4.5.6 Caterpillar

Exercise SHOW ME
 Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.

Leave a comment

Your email address will not be published. Required fields are marked *