Operator precedence (BASIC-style evaluation order): Match each operation category with its priority rank, where 1 is the highest priority and 4 is the lowest. List I (Operation) List II (Priority) A. Exponentiation 1. Highest B. Multiplication and division 2. Next C. Addition and subtraction 3. Next D. Expressions within parentheses 4. Lowest
-
AA-1, B-2, C-3, D-4
-
BA-2, B-3, C-1, D-4
-
CA-4, B-3, C-2, D-1
-
DA-2, B-3, C-4, D-1
Answer
Correct Answer: A-2, B-3, C-4, D-1
Explanation
Introduction / Context:Coding and math evaluation rules share a universal theme: parentheses first, then powers, then multiply/divide, and finally add/subtract. This item verifies your grasp of precedence in a BASIC-style hierarchy.
Given Data / Assumptions:
- Priority rank 1 is the highest, 4 is the lowest.
- Categories are grouped (e.g., * and / share a level).
- Parentheses explicitly override default precedence.
Concept / Approach:
The canonical order is: parentheses → exponentiation → multiplication/division → addition/subtraction. We simply map each category to its ordinal rank.
Step-by-Step Solution:
Parentheses have the highest priority ⇒ D-1.Exponentiation is evaluated next ⇒ A-2.Multiplication and division come after powers ⇒ B-3.Addition and subtraction are last ⇒ C-4.Verification / Alternative check:
Evaluate 2 + 3 * 4^2: parentheses first (none), exponent first (4^2=16), then multiply (3*16=48), finally add (2+48=50). This matches the mapped precedence.
Why Other Options Are Wrong:
- Putting exponentiation above parentheses defeats the explicit-grouping rule.
- Swapping add/sub before multiply/divide violates standard arithmetic precedence.
- Any scheme with parentheses not at the top is incorrect for BASIC-style evaluation.
Common Pitfalls:
Forgetting that nested parentheses are evaluated from the innermost outward, and confusing right-associative exponentiation behavior in some languages (which does not change its rank versus * and +).
Final Answer:
A-2, B-3, C-4, D-1