Learn AP Comp Sci

☰

Problem of the Day

Friday, October 2, 2026


Problem:

Computer programs often have errors in them. Which of the following is an acceptable debugging strategy for identifying the source of an error in a program?

  1. Inserting println statements that print out the values of variables at given checkpoints
  2. Using a debugger in an Integrated Development Environment to analyze the code as it executes
  3. Going through the code "by hand" one instruction at a time, writing down values for variables and tracking the program's execution
  1. II only
  2. I and II only
  3. II and III only
  4. I, II, and III

Show solution:

The correct answer is d. All three strategies can be useful in helping understand why a given program might not be working as intended.