AP CSP Day 39: Network Architecture

Big Idea 3: Algorithms & Programming
Cycle 2 • Day 39 Practice • Hard Difficulty
Focus: Procedural Abstraction

Practice Question

A programmer creates two versions of a GPA calculator:

Version 1: All calculation logic is written directly in the main program. Version 2: The calculation is placed in a procedure called calculateGPA that takes a list of grades and returns the GPA.

Which of the following are advantages of Version 2?

I. The GPA calculation can be reused elsewhere without duplicating code.
II. The main program is easier to read because calculation details are hidden.
III. Version 2 will always compute a more accurate GPA than Version 1.

Why This Answer?

I is correct: procedures enable code reuse without duplication. II is correct: moving details into a named procedure makes the main program more readable through abstraction. III is false: both versions can implement the same formula with identical accuracy. Abstraction affects organization, not mathematical correctness.

Why Not the Others?

B) Statement II is also a valid advantage, not just statement I. C) Statement III is false — abstraction does not inherently improve calculation accuracy. D) Statement III is false, so "all three" is incorrect.

Common Mistake
Watch Out!

Students conflate better code organization with better computational results. Procedural abstraction improves readability, maintainability, and reusability — not output accuracy.

AP Exam Tip

For I/II/III format questions, evaluate each statement independently. Do not assume that if two are true, the third must also be true.

Keep Practicing!

Consistent daily practice is the key to AP CSP success.

AP CSP Resources Get 1-on-1 Help
Back to blog

Leave a comment

Please note, comments need to be approved before they are published.