Passing parameters

If w e look at the previous examples of the use of functions, we see that in the function doubleValue there was one parameter passed into it, called anyNumber, that didn't change within the function: the purpose of this parameter w as to supply information. On the other hand, when w e passed the parameters theRepName and theAddess to the function GetMaxSaleslnfo these could be changed within it, for their purpose was to represent the rep name and cell address associated with the maximum sales value. Since the maximum sales is a variable, then so are the values of theRepName and theAddress and therefore their values could change within the function. There are two methods of passing arguments: by reference and by value.

0 0

Post a comment