ram is in the image attached) What is the output of the following Ada-like program (two hyphens indicate a line comment). A. if the program la

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter9: Completing The Basics
Section: Chapter Questions
Problem 7PP
icon
Related questions
icon
Concept explainers
Question

(The program is in the image attached) What is the output of the following Ada-like program (two hyphens indicate a line comment).

A. if the program languages uses deep binding?

B.if the programming language uses shallow binding?

1. What is the output of the following Ada-like program (two hyphens indicate a line comment):
procedure SUB1;
var x: integer;
1
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
procedure SUB5;
var x: real;
begin --SUB5
x = 5;
SUB2; call SUB2
SUB4; call SUB4
end; --of SUB5
procedure SUB4;
var x: integer;
begin --SUB4
x := 4;
SUB3 (SUB2); --pass SUB2 to SUB3
end; --of SUB4
procedure SUB3 (SUBX) ;
var x: real;
begin --SUB3
x:=3;
SUBX; --call passed int procedure
end; -of SUB3
procedure SUB2;
begin --SUB2
write("x = ", x);
end; of SUB2
begin --SUB1
x = 1;
SUB5; call SUBS
end; of SUB1
A. If the programming language uses deep binding?
B. If the programming language uses shallow binding?
Transcribed Image Text:1. What is the output of the following Ada-like program (two hyphens indicate a line comment): procedure SUB1; var x: integer; 1 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 procedure SUB5; var x: real; begin --SUB5 x = 5; SUB2; call SUB2 SUB4; call SUB4 end; --of SUB5 procedure SUB4; var x: integer; begin --SUB4 x := 4; SUB3 (SUB2); --pass SUB2 to SUB3 end; --of SUB4 procedure SUB3 (SUBX) ; var x: real; begin --SUB3 x:=3; SUBX; --call passed int procedure end; -of SUB3 procedure SUB2; begin --SUB2 write("x = ", x); end; of SUB2 begin --SUB1 x = 1; SUB5; call SUBS end; of SUB1 A. If the programming language uses deep binding? B. If the programming language uses shallow binding?
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT