Question

(17) (1 mark) What is the static parent of a subprogram? (18) (1 mark) What is a formal parameter? (19) (3 marks) Consider th

0 0
Add a comment Improve this question Transcribed image text
Answer #1

17.what is the static parent of a subprogram?
ANS: Static chains are primary method of implementing accesses to non-local variables in static-scoped languages with nested subprogram. Static chain is a chain of static links that connects certain activation record instances. The static chain from an activation record instance connect it to all of its static ancestors. The static link in an activation record instance for subprogram A points to one of the activation record instances of A's static Parent.

18.what is a formal parameter?
The identifier used in a method to stand for the value that is passed into the method by a caller.

19. int x;
void f(int a){a=a+2; x=x+1;}
void main(){
   x=1;
   f(x); printf("x=%\n",x)
}
what value of x will be printed by the main program under each of the following conditions?Imagine that formal parameter a of function f is being passed

ANS:

by value: x=1

by value result: x=3

by reference: x=2

Add a comment
Know the answer?
Add Answer to:
(17) (1 mark) What is the static parent of a subprogram? (18) (1 mark) What is...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. What is the output when you run printIn()? public static void main(String[] args) { if...

    1. What is the output when you run printIn()? public static void main(String[] args) { if (true) { int num = 1; if (num > 0) { num++; } } int num = 1; addOne(num); num = num - 1 System.out.println(num); } public void addOne(int num) { num = num + 1; } 2. When creating an array for primitive data types, the default values are: a. Numeric type b. Char type c. Boolean type d. String type e. Float...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT