Please enable JavaScript to use CodeHS

South Carolina Fundamentals of Computing

Lesson 3.10 For Loops

Description

In this lesson, students learn how to use for loops in their programs. The for loop allows students to repeat a specific part of code a fixed number of times.

For loops are written like this:

for(var i = 0; i < 4; i++)
{
    // Code to be repeated 4 times
}

Objective

Students will be able to:

  • Create for loops to repeat code a fixed number of times
  • Explain when a for loop should be a used
  • Utilize for loops to write programs that would be difficult / impossible without loops

Activities

These are all the activities included in the lesson

3.10.1 For Loops
3.10.2 For Loops Quiz
3.10.3 Repeated Move
3.10.4 Put Down Tennis Balls
3.10.5 Take 'em All
3.10.6 Dizzy Karel
3.10.7 Ball in Each Corner
3.10.8 Lots of Hurdles