Question: Given the following ALGOL code: ( * please notice any text between ( * * . . * * ) is a comment. Also, all

Given the following ALGOL code:
(* please notice any text between (**..**) is a comment. Also, all labels blk1, blk2, blk3 are not
part of the program, they just to show you the starting of blocks' codes.*)
main: begin (* main program block definition *)
integer h,m; real n;
procedure P(k); value k ; integer k;
blk1: begin integer o;
procedure R(q); value q; real q;
blk2: begin real v; v := q+ m; PrintInteger(v); end (* blk2*);
procedure S(i); value i; integer i;
blk3: begin integer m;m:=i+15;R(m) end ();
(**blk1-P code **)
o:=k+m;S(o);
end (**blk1-P code **)
begin (* the main program block code *)
h:=25;m:=30;n:=2.7;P(h)
end (* end of main program (block) code *)
end (* end of main program (block) definition *)
a) What would be the printed value of "v", in blk2 above, in each of the following
scoping mechanisms: i) static? ii) dynamic?
You must show the picture of the system stack upon the execution of the "PrintInteger(v)".
 Given the following ALGOL code: (* please notice any text between

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!