onsider the following program: program main; var x, y, z : integer; procedure subl; var a, y, z : integer; begin { subl } end; { subl } procedure sub2; var a, b, z : integer; begin { sub2 } end; { sub2 } procedure sub3;

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.2: Returning A Single Value
Problem 13E
icon
Related questions
Question

dont post copied content

direcly dislike

 

Question 3
Consider the following program:
program main;
var x, y, z : integer;
procedure subl;
var a, y, z : integer;
begin
{ subl }
end;
{ subl }
procedure sub2;
var a, b, z: integer;
begin { sub2 }
{ sub2 }
end;
procedure sub3;
var a, x, w: integer;
begin { sub3 }
end;
{ sub3 }
begin { main }
end.
{ main }
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 sub3; sub3 calls sub2; sub2 calls sub1.
Transcribed Image Text:Question 3 Consider the following program: program main; var x, y, z : integer; procedure subl; var a, y, z : integer; begin { subl } end; { subl } procedure sub2; var a, b, z: integer; begin { sub2 } { sub2 } end; procedure sub3; var a, x, w: integer; begin { sub3 } end; { sub3 } begin { main } end. { main } 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 sub3; sub3 calls sub2; sub2 calls sub1.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Search Engine
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr