Beruflich Dokumente
Kultur Dokumente
REVIEW QUESTIONS
1. In Java and C#, how long can a name be?
Names in Java and C# have no length limit
2. How can a variable be characterized?
A variable can be characterized as a sextuple of attributes: (name, address, value, type,
lifetime, and scope)
3. What is deallocation of a memory cell?
Deallocation is the process of placing a memory cell that has been unbound from a variable
back into the pool of available memory
4. After language design and implementation, what are the four times bindings can take
place in a program?
compile time, load time, link time, and run time.
5. How is a reference to a nonlocal variable in a static-scoped program connected to its
definition?
A reference to a non-locally variable in a static-scoped language with nested subprograms
requires a two-step access process:
1. Find the correct activation record instance
2. Determine the correct offset within that activation record instance.
PROBLEM SET
1. Which of the following identifier forms is most readable? Support your decision.
FirstName
First_Name
firstname
First_Name is the most readable, because it doesn’t have any problem whit sensitives
cases, also because the following identifier doesn’t use caps lock.
2. Consider the following JavaScript skeletal program:
Assume that the execution of this program is in the following unit order:
main calls sub1
TALLER • Lenguajes de Programación José Montes & Arnulfo Torres
a. Assuming static scoping, in the following, which declaration of x is the correct one
for a reference to x?
i. sub1: sub1
ii. sub2: sub1
iii. sub3: main
b. Repeat part a, but assume dynamic scoping.
i. sub1: sub1
ii. sub2: sub1
iii. sub3: sub1
2. x = 15 (sub2),
TALLER • Lenguajes de Programación José Montes & Arnulfo Torres
w = 17 (sub2),
a = 13 (sub2),
y = 9 (sub1);
3. x = 15 (sub2),
b = 21 (sub3),
a = 19 (sub1),
z = 23 (sub3),
w = 17 (sub2);
4. x = 15 (sub2),
b = 21 (sub3),
a = 19 (sub1),
z = 23 (sub3),
w = 17 (sub2);