Question: Q2) Think About the following segment code that is written in a new language currently under design. The designers cannot decide whether to adopt dynamic

Q2) Think About the following segment code that is written in a new language currently under design. The designers cannot decide whether to adopt dynamic or static scoping. program test. var a, b: integer. procedure subi. var a, c, e: integer; begin a : 6; c:7; e = 8; {position 3) end; (subl) --- procedure sub2; var a, c, d: integer; begin a : 3; C: - 4: d = 5: (position 2) subl(); end: sub 2) begin a : 1; b: 2; (position 1) sub 2 (); end. (test) A. Determine what variables are visible at positions 1, 2, 3 and what their values are (given the call sequence indicated) with static scoping. B. Determine what variables are visible at positions 1, 2, 3 and what their values are (given the call sequence indicated) with dynamic scoping
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
