Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following pseudocode: What does the program print or will the compiler identify static semantic errors if: a) names must be declared before use,

  1. Consider the following pseudocode:

image text in transcribed

What does the program print or will the compiler identify static semantic errors if:

a) names must be declared before use, and the scope of a name extends from its declaration through the end of the block?

b) names must be declared before use, but the scope of a name is the entire block in which it is declared?

c) names can be declared in any order, and their scope is the entire block in which they are declared?

  1. Suppose that procedure swap is declared as follows (using Pascal syntax):

image text in transcribed

Describe the effect of the procedure call swap(i, A[i]) assuming that macro expansion is used.

- : ? : ;F- F procedure main() a: integer 11 b: integer : 2 2 C: integer :-) procedure first b: integer :c C: integer :- procedure second) print a, b, c a: integer : 2 --body of first second) print a, b, c --body of main first print a, b, c 10. procedure swap(x,y: integer); procedure f(a): integer; begin 1 f*) ay return x end fi begin swap y = f(x) and swap

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

Finance The Basics

Authors: Erik Banks

3rd Edition

1138919780, 9781138919785

More Books

Students also viewed these Accounting questions

Question

understand corporate liquidity and the factors that drive it

Answered: 1 week ago