Question: Question 5 (5+2+2+2=11 points ) Consider the following C++ program: int count = void red() { count +=1 void blue (funR) { int count =0

 Question 5 (5+2+2+2=11 points ) Consider the following C++ program: int

Question 5 (5+2+2+2=11 points ) Consider the following C++ program: int count = void red() \{ count +=1 void blue (funR) \{ int count =0 funR() print "blue", count. \} void green()\{ int count =0 blue (red) print "green", count. \} print "countervalue", count. void main() \{ green() print What would it print if this language uses: Justify your answer by showing the hierarchy of symbol tables at the print statement (assume that each table contains two columns: name and type ). (5 points**) **(Note: Symbol tables (ST) carry 5 points - we recommend approaching the below questions by creating all the ST and then referring the STs to answer the below questions.) 1. (2 pts) Static scoping. Justify your answer with a symbol table hierarchy. 2. (2 pts) Dynamic scoping using shallow binding. Justify your answer with a symbol table hierarchy. 3. (2 pts) Dynamic scoping using deep binding. Discuss clearly what happens at line 15 , which symbol table is passed

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!