Dividing Problems Up Into Modules: Functions And Procedures
Notes for the required material
- These notes can be purchased in the Student Union Copy Center at cost
- Functions and Procedures in Pascal (Leestma & Nyhoff Sections
5.1, 5.2, 5.5 and 5.6). However, you don't need to worry
about defining functions within functions (like they illustrate in Section
5.6). You may also want to read through Section 5.3, 5.4 and 5.7 for
additional examples, the latter Section provides an example of applying the
top-down approach from the design step to actual implementation in Pascal: [PowerPoint]
[Acrobat: 2 slides/page] [Acrobat:
6 slides/page]
Optional teaching material
Background / Sources of additional information
- Pascal Programming and Problem Solving by Leestma S. and Nyhoff L. 4th
Edition (MacMillan Publishing Company).
- Pascal an Introduction to the Art and Science of Programming by Savitch
W.J. (The Benjamin / Cummings Publishing Co., Inc.).
- The Pascal link under the
GNU website (since the U of C Computer Science department uses the GNU Pascal
compiler gpc).
Teaching Tips
I have found that because functions and procedures involve a lot of new
concepts that it takes students quite a while to absorb everything.
Consequently I have found it useful to separate when I talk about functions with
when I talk about recursion. This allows students some time to absorb the
basic concepts before proceeding onto something much more advanced.