Machine-translated by Google. Questions are authored in English.
Top

Discussion

Match each attribute usage with the direction of information flow.
List I
A. the value of an arithmetic expression
B. the type declared for a list of names
C. the width of a generated code fragment
D. the nesting level of the enclosing block
List II
1. upward, synthesised
2. upward, synthesised
3. downward, inherited
4. downward, inherited

  • A.A-2, B-4, C-1, D-3
  • B.A-4, B-2, C-1, D-3
  • C.A-2, B-4, C-3, D-1
  • D.A-3, B-1, C-4, D-2

Answer: A

Correct answer: A-2, B-4, C-1, D-3

The direction follows from where the information comes from. An expression’s value and a code fragment’s width are both built up from the parts below, so they are synthesised. A declared type must be passed down to the list of names it applies to, and a nesting level comes from the enclosing block, so both are inherited.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.