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…
* Explain the three parts of the for loop (initialization statement, test statement, increment statement)
* Create for loops that iterate differently than the basic for loop structure (ie count by twos or count backwards)


These are all the activities included in the lesson.


4.6.1 General For Loop


4.6.2 General For Loop Quiz


4.6.3 Countdown


4.6.4 Count By Twos


4.6.5 Count By Sevens

Exercise SHOW ME

4.6.6 Powers of Two

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 *