Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( 3 0 pts ) Consider the following pseudocode: procedure main a: integer : = 1 b: integer : = 2 procedure middle a :

(30 pts) Consider the following pseudocode:
procedure main
a: integer :=1
b: integer :=2
procedure middle
a : integer := b
procedure inner
print a,b
b: integer :=3
// body of middle
inner ()
print a,b
// body of main
middle ()
print a,b
Indicate which declarations of a and b are in the referencing environment at each print statement and what the program prints (or whether the compiler Identify static semantic errors)
a.(10 pts) using the declaration-order 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.(10 pts) using the declaration-order 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.(10 pts) using the declaration order rules Modula-3: names can be declared in any order, and their scope is the entire block in which they are declared.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Describe the patterns of business communication.

Answered: 1 week ago

Question

3. Provide two explanations for the effects of mass media

Answered: 1 week ago