Hello Computer Science: Loops in C++

Prepare today for the demands of tomorrow.

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:

All of the computer_science activities with description in Arabic, 汉语, English, Français, Deutsch, Indonesian, Italiano, 日本語, Portuguêes, Русский, Español,


Copyright © Hello World Publications. All rights reserved worldwide.

hello-world.com
Privacy
Policy

Site map

Hello-World