Exercise 6.7.9: [Seb10] Consider the following skeletal Ada program: 1 procedure
ID: 3854815 • Letter: E
Question
Exercise 6.7.9: [Seb10] Consider the following skeletal Ada program: 1 procedure Main is X Integer This is a forward declaration of Proc3 procedure Proc3 It allows Proc 1 to procedure Pr is Integer procedure Proc2 is of Proc begin end of Proc2 10 of Procl begin 11 12 CHAPTER 6. BINDING AND SCOPI 244 end of Procl 13 14 procedure Proc3 is 15 begin of Proc 16 17 end of Proc 18 19 20 begin of Main 21 22 end of Main Assume that the execution of this program is in the following order: Main calls Procl Procl calls Pro Proc calls Proc3Explanation / Answer
a)proc1 gets value of x from proc1, proc2 gets value of x from proc1 whereas proc3 gets value of x from main program.
b) in dynamic, proc1 gets value of x from proc1, proc2 gets value of x from proc1 as well as proc3 gets value of x from proc1 itself.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.