At the end of the 8th week
you will be able to use loops.
You will use for loops, do loops, and while loops.
You will learn what an endless loop is and how to avoid them.
1. Print and read the lesson. Follow all
instructions as you go along.
(Punch, staple, put in your binder.)
2. Run each of the demos, flowcharts or other materials from the lesson.
3. Write each of the programs in the lesson.
To get the most out of these programs
- Following the instructions, get the program to work.
- 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!
4. All of the programs from the lesson are in an executable zip file.
When you click on this link, save the zip file to your disk.
Double click on the EXE file and unzip all of the files to a directory
created for this lesson.
Compare the code in the programs to the ones you wrote.
Code from lesson 8: 1, 2, 3, 4, 5, 6, 7, 8, 9
5. Do the self test questions and check your answers.
6. Using the sample programs as a model, write a completely
new program that uses the same techniques.
Programming Exercise:
Using what you learned in lesson 8, create an application
that calculates and prints the first 20 values of the Fibonacci sequence:
The Fibonacci sequence starts with 0 and 1.
Each number after that is
found by adding together the previous 2 numbers: 0 1 1 2 3 5 8 13 21
34 56...
- Optional: use a scroll bar to select the number of values to print.
Use your imagination to create a useful application!
|