Subsection 2.3.5 Problems That Explore Operator Precedence
Exercises Exercises
Exercise Group.
1.
Suppose that you type the following arithmetic expression into Excel or a simple calculator app such as this one.
\(3*12+8/4 \)
(Part 1) What answer will you get:
15
42
38
11
2.
(Part 2) In what order were the operators performed to get that answer?
Multiply 3*12, then add 8, then divide by 4.
Add 12 and 8, then multiply by 3, then divide by 4.
Divide 8 by 4, add that to 12, then multiply by 3.
Multiply 3 by 12. Divide 8 by 4. Add those two numbers
Exercise Group.
2.
Suppose that you type the following arithmetic expression into Excel or a simple calculator app such as this one:
12 + 16 * 2 + 1
(Part 1) What answer will you get:
57
45
51
84
b.
(Part 2) In what order were the operators performed to get that answer?
Multiply 16*2, then add that to 12. Finally, add 1.
Add 12 and 16, then multiply by 2, then add 1.
Add 2 and 1. Multiply 16 by that, then add to 12.
Multiply 3 by 12. Divide 8 by 4. Add those two numbers.