Question 1
In a certain computer program, two positive integers are added together, resulting in an overflow error. Which of the following best explains why the error occurs?
Main Solution
Correct Answer: C
An overflow error occurs in computing when the result of an arithmetic operation exceeds the maximum value that can be stored in the allocated number of bits. Because computers use a fixed number of bits (e.g., 32-bit or 64-bit integers) to represent integers, there is a finite maximum value that can be represented. When two positive integers are added and their sum surpasses this maximum representable value, the result cannot be stored correctly, causing an overflow error.
Option C directly and accurately describes this mechanism: the fixed-bit representation imposes a ceiling on representable values, and exceeding that ceiling produces the overflow.
Teacher Explanation
This question tests students' understanding of integer overflow as a consequence of fixed-width binary representation. In AP CSP, students should know that all data in a computer is represented using a finite number of bits, which limits the range of values that can be stored. When an arithmetic result exceeds that range, an overflow error results. This is distinct from floating-point precision errors (option B) or undecidability (option A).
Education Coach Advice
On the AP CSP exam, carefully distinguish between overflow errors (integer result too large for fixed bits) and roundoff/precision errors (floating-point approximation). Key phrase in the question: "two positive integers are added" and "overflow error" — this points directly to the fixed-bit integer representation limit. Eliminate options about undecidability (a logic/computability concept) and floating-point (a different representation type) first.
Traps
Most appealing wrong answer: B. Students may confuse overflow with floating-point precision errors. Floating-point representation causes rounding/precision issues, not overflow errors for integer addition. Overflow is specifically about exceeding the maximum value storable in a fixed number of bits for integers, not about approximation in floating-point. Option D is also tempting but is incorrect because integers are representable exactly in binary; the issue is the size limit, not approximation.
Answer images

