Exam-style question
Try this first
Which situation best demonstrates functional abstraction?.
- A.A programmer calls a function for a result without needing to know how the result is computed
- B.A programmer writes every computation directly in the main part of a program
- C.A programmer chooses a variable name that describes the data it stores
- D.A programmer copies the same calculation into several different parts of a program
Model answer
What a good answer should say
- A programmer calls a function for a result without needing to know how the result is computed
Explanation
Why this works
Functional abstraction disregards the particular computation method. The function can therefore be used for its result without exposing its implementation.
Common mistake
No common mistake is linked to this question yet.
