Lecture 6.2 Notes

advertisement
BIT 115
Lecture 6b
Page 1 / 1
NOTE TO STUDENTS:
These notes are for the instructor's use. If you happen to find them to be useful,
that's great. If not, then please ignore these. Thanks!
—The Instructor
Lecture 6b:
Loop Patterns: Counting
There are certain arrangements of code that you'll see again & again
For example, if you want to count from one number to another, you'll end up with code that's
similar to every OTHER time you want to do this.
These similarities are good to notice
Instead or reinventing the wheel each time, REUSE stuff
I'm going to call these 'patterns'
The details (like what a variable is named, etc) will change
The important parts, the structure, won't.
Looping until something is true
Looping until something is not true
<Find all the errors, then trace it>
BIT 115
LECTURE 6.b
Page 1 / 1
Download