Difficulty: Medium
Correct Answer: 10 10
Explanation:
Introduction / Context:
This exercise tests understanding of default arguments, pass-by-value, and chained assignments with compound operators. It asks you to follow exact state changes inside Apply and then print two members using Display.
Given Data / Assumptions:
Concept / Approach:
Carefully evaluate compound assignments which both change the left-hand operand and yield a value. Keep track of x and y after each statement to determine what Display prints.
Step-by-Step Solution:
Verification / Alternative check:
Rewriting as yy = yy + 10; y = yy; x = x - 2; z = x; confirms the same final member values.
Why Other Options Are Wrong:
Common Pitfalls:
Thinking yy += 10 returns the old value, or assuming parameters are references; both lead to incorrect y values.
Final Answer:
10 10
Discussion & Comments