Comprehensive and Detailed Explanation From Exact Extract:
The expression x - y * 2 involves subtraction and multiplication, evaluated according to operator precedence. According to foundational programming principles (e.g., C and Python standards), multiplication (*) has higher precedence than subtraction (-), so y * 2 is computed first.
Given: x = 12, y = 4.
Compute: y * 2 = 4 * 2 = 8.
Then: x - (y * 2) = 12 - 8 = 4.
Option A: "4." This is correct, as calculated above.
Option B: "6." This is incorrect. It might result from misinterpreting precedence (e.g., (x - y) * 2 = (12 - 4) * 2 = 16).
Option C: "8." This is incorrect. It might result from computing x - y = 12 - 4 = 8 and ignoring * 2.
Option D: "14." This is incorrect. It does not align with the expression’s evaluation.
Certiport Scripting and Programming Foundations Study Guide (Section on Operator Precedence).
C Programming Language Standard (ISO/IEC 9899:2011, Section on Expressions).
W3Schools: “Python Operators” (https://www.w3schools.com/python/python_operators.asp).
Submit