Week 5 - Loops

Learning Objectives

Upon finishing this learning module, you should be able to:

  • Write programs that use repetition structures to solve problems
  • Identify and use various strategies for controlling repetition
The midterm is this week.

Schedule

Day 1

In class:

  • Loop Intro
  • Loop Activity

Outside class:

  • Start Loops (Ch 8.1-8.6)
  • Start Ch 8 Exercise Set 1.

Day 2

In class:

  • Nested Loops

Outside class:

  • Continue on Loops (Ch 8.7-8.9)
  • Watch Loop Debugging video
  • Start Ch 8 Exercise Set 2. You can work on set 1 (non-nested loops) and set 2 (nested loops) at the same time. It is better to do a few problems from each set rather than doing all of one and none of the other.

Day 3

In class:

  • Loop Examples

Outside class:

  • Finish Loops (rest of Ch 8). Don't stress about remembering all the details of the examples in 8.11 and 8.13. Instead, focus on how the loops are used in each one.
  • Check out the assignment

Day 4



Loops

Read Ch 8 on Loops.

These videos review some of the ideas. They are not required, but may help with a particular concept.

Building up values: (8.4)


Nested loops: (8.8)


Loop Debugging

As your code gets more compelex, the debugger becomes even more important.

This video shows how to use the debugger to step through loops and skip ahead to particular iterations.

You will need to demonstrate (with a screenshot) using the debugger as part of this week's assignment.


Midterm

See last week for details on what to expect.