Question: 6) Consider the following pseudocode: x : integer := 9 y : integer := 20 procedure add() x := x + y procedure second(P :
6) Consider the following pseudocode: x : integer := 9 y : integer := 20 procedure add() x := x + y procedure second(P : procedure) x : integer := 3 P() procedure first() y : integer := 2 second(add) first() print x a) What does this program print if the language uses static scoping? Briefly explain. b) What does this program print if the language uses dynamic scoping with deep binding? Briefly explain. c) What does this program print if the language uses dynamic scoping with shallow binding? Briefly explain.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
