9pckgs_prc_fnc

9pckgs_prc_fnc - Introduction to Computers and Programming...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to Computers and Programming Lecture 9 Structuring Programs teams procedures , functions Packages Prof. I. K. Lundqvist Reading: B pp. 228-234, FK pp. 136-150, 182-193, 276-285 Sept 19 2003 Mechanisms to control complexity Abstraction Modularization Encapsulation •Modu la r i ty Partition system into modules
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Procedures procedure name (arguments) is constant definitions variable definitions procedure definitions begin --name statements end name; defined for use in this procedure only declaration definition Example procedure display is num : integer; begin --show_answer num:= 71; new_line; put(“the number of students is :”); put(num); new_line; end display; -- comment explaining purpose -- display a number
Background image of page 2
Procedure Call begin get_two_nums; add_two_nums; show_answer; end ; visible with Procedure Call and Return calling code called
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

9pckgs_prc_fnc - Introduction to Computers and Programming...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online