APCSP APCSP Program Design and Development 1 — Questions and Answers
Question 1: Which documentation practice best helps others understand a program's purpose?
- Removing all comments to reduce file size
- Writing comments that explain the 'why' behind complex logic (Correct answer)
- Using only variable names like x, y, z
- Compressing all code into a single line
Correct answer: Writing comments that explain the 'why' behind complex logic
Comments explaining the reasoning behind logic help future developers (and yourself) understand design decisions.
Question 2: What is the purpose of using a development process when building a program?
- To guarantee the program will have no bugs
- To provide a structured approach that reduces errors and improves collaboration (Correct answer)
- To make programming take longer
- To replace the need for testing
Correct answer: To provide a structured approach that reduces errors and improves collaboration
A structured development process (plan, design, implement, test) reduces errors and helps teams collaborate effectively.
Question 3: Which best describes an incremental development strategy?
- Writing the entire program before testing anything
- Building and testing small pieces of functionality before adding more (Correct answer)
- Only working on the user interface first
- Deleting old code and restarting frequently
Correct answer: Building and testing small pieces of functionality before adding more
Incremental development involves building small, testable components and integrating them step by step to reduce complexity.
Question 4: What does it mean to 'refactor' code?
- Delete unused files from the project
- Rewrite the code to improve structure without changing its behavior (Correct answer)
- Change what the program does to fix bugs
- Convert the code to a different programming language
Correct answer: Rewrite the code to improve structure without changing its behavior
Refactoring improves code readability and structure while keeping the program's external behavior identical.
Question 5: In the AP CSP 'Explore Task,' what must students include when citing a computational innovation?
- Only the URL of the website
- The name of the teacher who assigned the task
- Proper citation of sources including author, title, date, and URL (Correct answer)
- A screenshot of the innovation's homepage
Correct answer: Proper citation of sources including author, title, date, and URL
The AP CSP Explore Task requires complete citations so that sources can be verified and credit is properly given.
Question 6: Which practice best supports collaborative program development?
- Having only one person write all the code
- Using version control so team members can track and merge changes (Correct answer)
- Keeping all code in a single file
- Avoiding comments so team members read the code directly
Correct answer: Using version control so team members can track and merge changes
Version control systems like Git allow multiple developers to work simultaneously and merge changes without losing progress.
Which documentation practice best helps others understand a program's purpose?