| CE EN 270 - Virtual Lecture | |
| Norm Jones | Brigham Young University |
| Loops, Part 2 - More Examples | |
Instructions: Click on each of the links below, in order. You will need a Shockwave-enabled browser in order to view the lectures. As you view the lecture, use the controls at the bottom of the image to pause, stop, fast-forward, and rewind the lecture. These lectures contain audio. If you are viewing the lectures in a CAEDM lab, you will need to use a set of headphones to avoid disturbing your fellow students. |
|
Sections
|
Description |
| Review | Review of the syntax for the Do Loop and For Loop statements. |
| Task #1-1 | In-class task #1, part 1: Write a function that uses a Do Loop to test whether or not a number is prime. |
| Task #1-2 | In-class task #1, part 2: Re-write the prime number function using a For Loop. |
| Task #2-1 | In-class task #2, part 1: Write a loop that displays all of the factors of a given number. |
| Task #2-2 | In-class task #2, part 2: Write a loop that displays all of the prime factors of a given number. |