Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

College Algebra

Authors: Michael Sullivan, Michael Sullivan III

11th Edition

0135226864, 9780135226865

More Books

Students also viewed these Programming questions