course.wilkes.edu/CS125Labs
Welcome to the site for CS 125 labs!

 

Experiment 2: Value Parameters and Their Arguments

The Question: If a function alters the value of one of its value parameters, what is the effect on the argument corresponding to that parameter?

Hypothesis: Review the definition of value parameters, and then construct a hypothesis:



The Experiment: The current definition of program params takes the following steps:

   1. Assign initial values to arg1, arg2, and arg3;
   2. Display those values on the screen;
   3. Call Change(), passing it arg1, arg2, and arg3 as arguments 
         (and have Change() assign values to their corresponding parameters), and
   4. Display the values of arg1, arg2, and arg3.
By comparing the values displayed before the call with those displayed after the call, params provides us with a means of testing our hypothesis.

Observation: Execute your source program. What is displayed ?





Conclusions: Review the definition of a value parameter, and explain what happened.





 
  Home

Help

Lab 0

Lab 1

Lab 2

Lab 3a

Lab 3b

Lab 4

Lab 5

Lab 6

Lab 7

Lab 8

Lab 9

Lab 10

Lab 11

Lab 12

Lab 13



Membership

Login




Last update: Wednesday, August 23, 2000 at 3:07:11 PM.
visitors to this page.