Week 4 - Loops

Learning Objectives

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

  • Identify strategies for controlling repetition: counters, sentinels, and flags
  • Write programs that use repetition structures to solve problems

Day 1

  • Loops
  • Ch 5.1-5.3
  • CppLab Basic Loops

Day 2

  • Loop styles and strategies
  • Ch 5.4-5.5, and 5.7-5.9
  • CppLab Loops 2

Day 3

  • Nested Loops
  • Ch 5.10-5.13, 5.15
  • CppLab Nested Loops

Day 4

  • String Basics (Read Ch 4.8, 10.2, you can stop at 10.2.10)
  • String Practice WS

Online Activity Outline

Loops

Read Ch 5.1-5.3. This video introduces the key ideas:

Do CPPLab Basic Loops.

Read Ch 5.4-5.5 and 5.6-5.9 and watch this video:

Do CPPLab Loops 2.

Read Ch 5.10-5.13, 5.15 and watch this video:

Do Nested Loops CPPLab.

Read the rest of Ch 5.

Work on the assignment while you start preparing for next week by reading about strings below.

String Intro

Read Ch 4.8 and 10.2 (you can stop at 10.2.10). Watch this video that introduces the basics:

Go look up string on cplusplus.com - use the search box at the top, and do a search for "string". Then click on one of the functions, like "insert" and skim the documentation. You need to start getting used to looking up things - most programmers do that on the web instead of in textbooks, so start practicing!

Do the StringPractice worksheet from the files area of Elearn. Like previous practice sheets, try to predict the output for each statement then check your work against the key.