(Solved):
12. (1 pt) Consider the following program, written in JavaScript-like syntax: // main program \( \ ...
12. (1 pt) Consider the following program, written in JavaScript-like syntax: // main program \( \operatorname{var} \mathrm{x}, \mathrm{y}, \mathrm{z} \) function sub1() \{ var a, y, z; 3 function sub2() \{ var \( a, b, z \) war \} function \( \operatorname{sub} 3()\{ \) var a, x, w; \( \cdots \) \} Given the following calling sequences and assuming that dynamic scoping is used, what variables are visible during execution of the last subprogram activated? Include with each visible variable the name of the unit where it is declared. a. main calls sub1; sub1 calls sub2; sub2 calls sub3.