Difficulty: Easy
Correct Answer: 7 20.8
Explanation:
Introduction / Context: The function evaluates a cubic-like expression using Horner-style nesting. Default arguments make most coefficients zero unless explicitly provided. You must track which parameters receive values and which default to zero.
Given Data / Assumptions:
Concept / Approach: For the first call, every nested term beyond p cancels to zero, leaving p. For the second call, only q contributes beyond p, scaled by x once. Evaluating carefully yields numeric results.
Step-by-Step Solution:
Call 1: p + (q + (r + sx)x)x with q=r=s=0 → 7 + (0 + (0 + 0)x)x = 7.Call 2: p=7, q=6, r=s=0 → 7 + (6 + (0 + 0)x)x = 7 + 6x = 7 + 62.3 = 7 + 13.8 = 20.8.Verification / Alternative check: Writing the general form as p + qx + rx^2 + sx^3 confirms that only qx contributes in the second call.
Why Other Options Are Wrong:
Common Pitfalls: Misplacing parentheses in nested expressions, or forgetting that only q survives when r and s are zero.
Final Answer: 7 20.8
Discussion & Comments