|
|
|
|
|
|
|
rameters' positions in each list. Copies of the values of size and initial are passed to the function; the location (memory address) of length is passed to the function. c. size and initial are protected from change because it is only copies of their values that are sent to the function. 6. In the block that forms the body of the function. Their initial values are undefined. 7. a. There will be two parameters: an int containing the number of values to be read and a float containing the computed average. b. The int should be a value parameter; the float should be a reference parameter. 8. The coding may be simplified if the function is called from more than one place in the program. |
|
|
|
|
|
|
|
|
Exam Preparation Exercises |
|
|
|
|
|
|
|
|
1. Define the following terms: |
|
|
|
|
|
|
|
|
2. Identify the following items in the program fragment shown below. |
|
|
|
 |
|
|
|
|
void Test( int, int, int );
int main()
{
int a;
int b;
int c;
.
.
.
Test(a, c, b);
Test(b, a, c);
.
.
.
}
void Test( int d,
int e,
int f )
{
int g;
int h;
.
.
.
} |
|
|
|
|
|