Professional Documents
Culture Documents
Ateneo Seatwork
Ateneo Seatwork
Activity 1
1. (1pt) True or false: A binding cannot be destroyed before the object it binds is destroyed.
False
2. (1pt) True or false: In C, static allocation does not allow for the storage of objects that
dynamically change in size.
True
3. (1pt) What rule does a PL follow where the bindings created during a subroutine call are
not destroyed upon exiting that subroutine?
DYNAMIC BINDING
4. (1pt) How could a program that seemingly occupies a small memory space at runtime
actually have a large reference environment that occupies a lot of memory?
There are instances where there are branches of code that are not executed at run time.
E.g. Only the applicable branch of code will execute in an if else statement no matter how
long branching the conditions are.
A programmer must take it into consideration at compile time to prepare for all possible
branches of decisions that may occur in the future. Thus, taking up more memory space
at compiling, but executing only one of those decision branches at compile time.
5. (1pt) What control structure can cause 10% of your physical code to run at 90% of time?
Explain your answer.
6. (3pts) When is the binding time of the following objects? Choose your answers from these
options: language design time, compile time, or binding time.
a. Data layout plan - language design time
b. String size - compile time
c. Data type - compile time
OPTIONS:
a. x in main() (global)
b. x in f1() (local)
9.
CS 112 Laboratory
Activity 1
CS 112 Laboratory
Activity 1
CS 112 Laboratory
Activity 1