1. Print and read the lesson. (Punch, staple, put in your binder.) Lesson 1: for loops

2. Run each of the programs from the lesson, work with the flowchart if one is provided:

Total1: no loop Flowchart
Total2: just 2 variables Flowchart
Total3: using a for loop to read 3 numbers Flowchart
Total4: uses a for loop to read N numbers Flowchart
Blast Off!: loop to print numbers
Count by 5: using a for loop
Powers of 2: for loop print 1 2 4 8 ...
Count by .5: for loop to print 1 1.5 2 2.5, etc.
Fractions: for loop to print 1/N
Alphabet: use for loop to print the alphabet
Binary: convert integer to binary. Optional: Lesson on binary numbers.

To get the most out of these programs

3. Take the quiz to check your understanding.

4. Using the sample programs as a model, write a program that will loop to input numbers. Print the total, count, average, smallest and largest.

Follow good programming habits:

Copyright © Zebra0.com
All rights reserved worldwide.

 
 

Loops in C++