Question: define function main(){ int X, Y, Z; --------------------- define function F(){ print(X, Y, Z); } //end F ------------------------------ define function R(function Q){ int X, Y;

define function main(){

int X, Y, Z;

---------------------

define function F(){

print(X, Y, Z);

}//end F

------------------------------

define function R(function Q){

int X, Y;

X = 4;

Z = 5;

Y = 6;

call Q();

}//end R

------------------------------

define function H(){

int X, Z;

---------------------

define function G(){

int X;

X = 7;

Y = 8;

Z = 9;

call R(F);

}//end G

---------------------

X = 10;

Z = 11;

call G();

}//end H

---------------------

// executable part of main

X = 1;

Y = 2;

Z = 3;

call H();

}//end main

Hello guys, i'm having trouble understanding this code properlly. is there anyone that can help me with it please.... I need to answer the below question and explaining to the answers. Thank you sooo much

Circle the visible variables inside function H assuming static scope rules:

Main::X Main::Y Main::Z R::X R::Y H::X H::Z G::X 2)

Circle the visible variables inside function H assuming dynamic scope rules:

Main::X Main::Y Main::Z R::X R::Y H::X H::Z G::X 3)

Fill in the values printed by the program if static scope is used.

X__1___ Y___8___ Z__5___

4) Fill in the values printed by the program if dynamic scope is used.

X__4___ Y__6___ Z__9__

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!