1) Given the following ‘generic’ program. var aVar; aVar = 10; sub1(); function sub1 () {  &...

Question:

1) Given the following ‘generic’ program.

var aVar;

aVar = 10;

sub1();

function sub1 ()

{

Sub2();

Print (“ aVar = “ aVar + “\n”);

}

function sub2()

{

var aVar;

aVar = 4;

}

What would be output under static-scoping rules?

What would be output under dynamic-scoping rules?

2)

Discuss and compare the following memory allocation strategies for variables, give an example of how Java and/or Python uses each:

1. Stack-Dynamic
2. Explicit Heap-Dynamic
3. Implicit Heap-Dynamic

3) What is a descriptor? What are the required entries in a Java array descriptor for an int and when must they be stored (compile-time or run-time)? Compare this to a Python descriptor for an int.

4) Identify and explain the two common problems with C++ pointers?

Similar Solved Questions

Bella Donna Paid in capital in excess of par? Please answer promptly and show all work....
Bella Donna Paid in capital in excess of par? Please answer promptly and show all work. Question 2 O out of 0.5 points Bella Donna Company has 100,000 shares of $4 par common stock issued and outstanding as of January 1, 2018. The shares were originally issued for$9 per share. On February 3, 2018,...
Explain the different between advocacy and guardianship? Do advocates have power of attorney over their clients?...
Explain the different between advocacy and guardianship? Do advocates have power of attorney over their clients? How do these powers impact on people under the age of 18?...
3. You have read that the harvest of Oranges is very, very good this season. a)...
3. You have read that the harvest of Oranges is very, very good this season. a) Graph a label the TYPICAL S & D for Orange Juice. b) Now, graph the new Supply of it. c) Is the NEW EQ Price Higher or Lower? d) Is the NEW EQ Quantity Higher or Lower? e) Which Determinant of Supply is this?...
Accounting
If a revenue expenditure is treated as a capital expenditure, thena. expenses are overstated and assets are overstated.b. expenses are overstated and owners' equity is understated.c. net income is overstated and owners' equity is understated.d. expenses are understated and owners' equity...
2. The A on a cello string has a frequency of 440 Hz. Assuming the string...
2. The A on a cello string has a frequency of 440 Hz. Assuming the string is about 1m long, write an equation which describes the motion of the cello string when it is played. Are there any free parameters? 3. For that same cello string, what is the frequency of the first harmonic? Write arn equatio...
Find the absolute minimum and maximum values of the function on the given region D. Be...
Find the absolute minimum and maximum values of the function on the given region D. Be sure to sketch D. f(x, y) = x+y-xy, D is the closed triangular region with vertices (0,0), (0,2), and (4,0). Hint: for this region, you have three lines, two are similar to the square problem and the hypothenuse ...
After spinning of photo resist over a wafer with prefabricated microstructures that introduce certain topology (i.e....
After spinning of photo resist over a wafer with prefabricated microstructures that introduce certain topology (i.e. non-flat surface) as shown bellow. Given the fact a g-line UV light exposure system with 257nm wavelength (i.e. λ=257nm).Based on your best scientific judgment (i.e. hand calcu...
Pilings are driven into the ground at a building site by dropping a 2150 kg object...
Pilings are driven into the ground at a building site by dropping a 2150 kg object onto them. What change in gravitational potential energy does the object undergo if it is released from rest 17.0 m above the ground and ends up 1.90 m above the ground? change in gravitational potential energy: J...
12:30 LTE X R assignment - Chapter 11 Wenton Powersports produces dune buggies. They have three a...
USING R 12:30 LTE X R assignment - Chapter 11 Wenton Powersports produces dune buggies. They have three assembly lines, Razo "Baze and Tracer,named ater the partioular dune buggy models produced on those ines. Each assembly line was originally designed using the same target pro...
I need help to journalize these transactions for accounting
I need help to journalize these transactions for accounting. Samantha purchased inventory costing 125,000 and sold 70% of the goods for 162,500 all purchases and sales were on account She later collected 25% of the accounts receivable Which is the perpetual inventory system inventory, revenues and ...
Causes of systemic lupus erythematosus for each system
causes of systemic lupus erythematosus for each system...
In a perfectly competitive market, if market demand increases as a result of advertising, the price...
In a perfectly competitive market, if market demand increases as a result of advertising, the price will .... in the shortrun and each firm will produce a ... quantity. A.increase, increase B.increase, decrease C.decrease, decrease D.stay the same, stay the same...
A buyer is deciding where to invest his money. He can purchase either an apartment building,...
A buyer is deciding where to invest his money. He can purchase either an apartment building, an office building or a warehouse. He considers two states of nature, either economic conditions will be good or poor with respective probabilities of 0.6 and 0.4. The table below summarizes is profit in tho...