Question: #12. (5 points) Consider the following program, written in JavaScript-like syntax: // main program var X, Y, 2; function subl() a, y, z) var function
#12. (5 points) Consider the following program, written in JavaScript-like syntax: // main program var X, Y, 2; function subl() a, y, z) var function sub20) var a, b, 2; function sub30) vara, X, W Given the following calling sequences and assuming that dynamic scoping is used, what variables are visible during the execution of the last subprogram activated? Include with each visible variable the name of the unit where it is declared. a. main calls subi; subi calls sub2; sub2 calls sub3. b. main calls subl; subi calls sub3. c. main calls sub2; sub2 calls aub3, sub3 calls subi. d. main calls sub3; sub3 calls subl. e. main calls sub3; sub3 calls aub2; sub2 calls subl
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
