Dale - Computer Science Illuminated 278

Dale - Computer Science Illuminated 278 - the subprogram...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Parameters The identi- fiers listed in parentheses beside the subprogram name; sometimes they are called formal para- meters. 8.3 Functionality of Imperative Languages 251 Figure 8.5 Subprogram flow of control (a) Subprogram A does its task and calling unit continues with next statement (b) Subprogram B does its task and returns a value that is added to 5 and stored in s u–LS0D 07 ;gB u–LS0D 07 ;gB s ) : F u–LS0D 07 kgB N21–09 02.–81 u–LS0D 07 kgB work, along with the types of each identifier placed in parentheses beside
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: the subprogram name. Because a subprogram is defined before it is called, it does not know with which variables from the calling unit it is to work. To solve this dilemma, we specify a list of variable names with associated types in parentheses beside the subprogram name. These identifiers are called parameters . When the subprogram is called, the calling unit lists the subprogram name followed by a list of identifiers in parentheses. These...
View Full Document

Ask a homework question - tutors are online