Exam-style question
Try this first
A calculation is performed using the values 8 and 5. Which change best demonstrates procedural abstraction?.
- A.Recording only the answer 13
- B.Replacing the calculation with a method that can add any two values
- C.Using larger values instead
- D.Writing down the two input values again
Model answer
What a good answer should say
- Replacing the calculation with a method that can add any two values
Explanation
Why this works
The particular values 8 and 5 have been abstracted away. The resulting method can be applied to other values.
Common mistake
No common mistake is linked to this question yet.
