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 nested modules (defining modules within modules (like the book shows 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]
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 link to the online
documentation for the GNU Pascal compiler (since you will be using the GNU
Pascal compiler 'gpc'). You may also be interested in browsing the rest
of the site
as well.
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 modules with
when I talk about recursion. This allows students some time to absorb the
basic concepts before proceeding onto something much more advanced.