Question: User Goals: Solidify understanding of pass - by - value vs pass - by - reference. Apply hand tracing to understand the logic of a
User
Goals:
Solidify understanding of passbyvalue vs passbyreference.
Apply hand tracing to understand the logic of a modular program.
Follow the execution of a program through it's function all stack.
Requirements:
For this exercise, you will hand trace provided code, filling values into boxes along the way. You won't write a program, rather, you will study the logic of the provided program and follow it's execution through memory as it updates variables. To get the maximum benefit of this lab, use hand tracing as covered in chapter Don't just type up the program and run it to find the answers see section
int barint a
return a ;
void fooint& a
a bara;
int spamint a int& b
float c a ;
b a ;
return c;
void eggsint& a int& b
int c a;
a b;
b c;
void baconint a
a ;
void hamint& a int b
static int c;
a c;
b c;
int main
int x y ;
X Y
baconx;
X Y
fooy;
X Y
x spamx y;
X Y
eggsx y;
X Y
forint i ; i ; i
hamx y;
X Y
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
