Question: ( 3 0 pts ) Consider the following pseudocode: procedure main a: integer : = 1 b: integer : = 2 procedure middle a :
pts Consider the following pseudocode:
procedure main
a: integer :
b: integer :
procedure middle
: integer : b
procedure inner
print
b: integer :
body of middle
inner
print
body of main
middle
print
Indicate which declarations of a and are in the referencing environment at each print statement and what the program prints or whether the compiler Identify static semantic errors
a pts using the declarationorder rules of C but with nested subroutines: names must be declared before use, and the scope of a name extends from its declaration through the end of the block.
b pts using the declarationorder rules of C#: names must be declared before use, but the scope of a name is the entire block in which it is declared.
c pts using the declaration order rules Modula: names can be declared in any order, and their scope is the entire block in which they are declared.
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
