Question: Consider the following program: In each case YOU MUST SHOW ALL OF YOUR WORK proc main int X, Z; proc A: int a; proc

Consider the following program: In each case YOU MUST SHOW ALL OF YOUR WORK proc main int X, Z; proc A: int 

Consider the following program: In each case YOU MUST SHOW ALL OF YOUR WORK proc main int X, Z; proc A: int a; proc B; int x, a; { x:= 2; a:= 8; call C; print x; } (end B) proc C; int z; {x = 4; z = 7; print a; } (end C) { x:= 3; z = 5; a:= 6; call B; print x;) (end A) proc D; int x, b; proc E; int x, Z; { x:= 5; z:= 11; call F; print x; } (end E) proc F; proc G; { print z; x:= 8; call A; print x; } (end G) { print x; call G; x:=7; } (end F) { x:= 12; call E; print x; } (end D) { x:= 1; z:= 9; call D; print x; } (end main) (a) (6pts) What is the program output assuming static scoping rules are employed? (b) (6pts) What is the corresponding output when dynamic scoping rules are employed? (c) (5pts) List all of the units (proc's) that proc C can call (assuming static scoping). (d) (4pts) Specify the referencing environment of proc F (assuming static scoping) That is, list the variables that are visible to proc F

Step by Step Solution

3.38 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The provided image contains a text of a programming code structure with various procedure definitions and nested procedure calls This is a pseudocode representation rather than code specific to a prog... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!