At the end of this lesson you will know
what a structured program is and how to write one.
1. Print and read the lesson. (Punch, staple, put in your binder.) Structured Programs
2. Run each of the programs from the lesson, work with the flowchart if one
is provided:
To get the most out of these programs
- Run the flowchart (if provided) to help understand the logic.
- Copy the program, paste it into your C++ compiler and run it.
- Experiment with it: make little changes and see what happens, make sure
you understand it.
- Erase it - now try to write it without looking at your notes!
3. 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:
- Indent each statement inside the curly braces about 2 spaces. All of the
statements should line up.
- Use good variable names and comments: if you look at the program in a year,
will you know what the program does?