Answer to Question 05B-1

The simulation is similar to the one shown for test(3), but it starts with z = 2, causing test(2) to return 32. Here it is.
test
z = 2
at: int k = fourthPower(z);
test
z = 2
at: int k = fourthPower(z);
fourthPower
y = 2
at: int s = sqr(y);
test
z = 2
at: int k = fourthPower(z);
fourthPower
y = 2
at: int s = sqr(y);
sqr
x = 2
at: return x*x;
test
z = 2
at: int k = fourthPower(z);
fourthPower
y = 2
s = 4
at: int r = sqr(s);
test
z = 2
at: int k = fourthPower(z);
fourthPower
y = 2
s = 4
at: int r = sqr(s);
sqr
x = 4
at: return x*x;
test
z = 2
at: int k = fourthPower(z);
fourthPower
y = 2
s = 4
r = 16
at: return r;
test
z = 2
k = 16
at: return 2*k;

Test returns 32, and its frame is destroyed.