Practice a Create-Performance-Task-style written response about a program's purpose, errors, and development. Write your response, then reveal the model answer to see exactly what earns each point.
Note: The AP CSP exam is all multiple-choice; extended writing appears in the Create Performance Task. This question gives you practice with that style of written response.
A student develops a program that helps users track how many glasses of water they drink each day. The user taps a button each time they drink a glass, and the program displays the running total and a message when the daily goal is reached.
The program's function is to count the glasses of water a user drinks and display the running total, showing a message when the daily goal is reached. Its purpose is to help people stay hydrated by making it easy to track their water intake. An input is the user tapping the button (each tap signals one glass); an output is the running total (and goal message) shown on the screen.
Because the program runs but produces an incorrect result, this is a logic error — the counting logic is flawed rather than the grammar of the code. The student could identify it by testing with known inputs (for example, tapping exactly 3 times and checking whether the total shows 3) and hand-tracing the code that updates the total. A likely fix is correcting where or how the counter is incremented — for instance, starting the count at 0 and adding 1 on every tap.
An iterative process means the student builds and tests the program in small steps, refining it with feedback each pass rather than finishing it all at once. After a first prototype, the student could ask users with diverse perspectives to try it and share feedback — for example, that the goal should be adjustable, or that the button is hard to reach. Each round of investigating, designing, prototyping, and testing lets the student catch errors earlier and add improvements, producing a program that is more correct, more usable, and better matched to its purpose.