AP CSP Day 59: Digital Citizenship
Share
Practice Question
Two programmers are building a weather app. Programmer A writes a procedure called convertTemp that takes a Fahrenheit value and returns the Celsius equivalent. Programmer B displays the converted temperature in the user interface but does not know the conversion formula.
Which of the following best describes how procedural abstraction benefits this collaboration?
Procedural abstraction provides a clear interface: Programmer B knows that convertTemp accepts a Fahrenheit number and returns a Celsius number. This is sufficient to use the procedure correctly without understanding the internal formula (C = (F-32) * 5/9).
A) The entire point of abstraction is that Programmer B does NOT need to understand the internal formula. C) A procedure is written once and called from multiple locations — no rewriting is needed. B) Abstraction enables independent work; both programmers do not need to collaborate on every detail.
Students think that to use a procedure, you must understand how it works internally. Procedural abstraction specifically means you only need to know the interface (inputs and outputs), not the implementation.
Procedural abstraction enables collaboration: one person writes the procedure, another uses it. The user only needs the interface (what goes in, what comes out), not the implementation details.
Keep Practicing!
Consistent daily practice is the key to AP CSP success.
AP CSP Resources Get 1-on-1 Help