|
Practice Exercise 7 Parameter Passing |
![]() |
Objective: To become familiar with parameter passing. Exercise 1: Write a procedure that computes the value of an investment p after n years of interest at rate r compounded quarterly. Write a brief program to make use of this procedure. Should your procedure be a
sub or a function? Should the parameters be passed by value or by reference? Exercise 2: Given the following procedure body, write a heading that declares ByVal and ByRef parameters as necessary. (Hint: Make a list of all identifiers in the procedure and notice which ones aren't declared locally.
|