Program Design and Development (College Board AP® Computer Science Principles): Exam Questions

25 mins25 questions
1
1 point

In an event-driven program, what determines the order in which code runs?

  • The alphabetical order of the variable names

  • The events that occur, such as user actions

  • The total number of lines in the program

  • A fixed top-to-bottom sequence that never changes

2
1 point

A section of code that runs in response to a specific event being detected is called a(n):

  • Parameter

  • Event

  • Event handler

  • Output

3
1 point

In a media player, a user drags a slider to set the playback volume. What is the input?

  • The media player application itself

  • The slider control on screen

  • The sound produced by the speakers

  • The volume value the user selects

4
1 point

A program reads yesterday's sales totals from a saved spreadsheet on the computer. Which input source category is this?

  • File input

  • Sensor input

  • Network input

  • User input

5
1 point

Consider the following code segment.

count ← 3
total ← count * 10
count ← 8
DISPLAY(total)

What value is displayed?

  • 80

  • 30

  • 13

  • 18

6
1 point

A handheld game controller vibrates when the player loses a life. This vibration is an example of which type of output?

  • Auditory output

  • Visual output

  • Tactile output

  • Input

7
1 point

Why can reordering two statements change a program's output, even when each statement is correct on its own?

  • Because output is decided before the program runs

  • Because the computer runs statements in a random order

  • Because reordering changes the program's comments

  • Because a later statement may depend on a value produced by an earlier one

8
1 point

A team is asked to build software for a problem that is not well understood, so they experiment with several different approaches to discover a workable solution. Which development methodology does this describe?

  • Exploratory

  • Sequential

  • Iterative

  • Incremental

9
1 point

Which situation is best suited to a sequential development methodology?

  • The requirements are expected to change frequently

  • The requirements are well-defined and unlikely to change

  • The problem is poorly understood at the start

  • Constant user feedback is needed throughout

10
1 point

A developer releases a working app, then in each later release adds one new, separately testable feature — first messaging, then photo upload, then notifications. This is best described as:

  • Sequential development

  • Iterative development

  • Incremental development

  • Exploratory development

11
1 point

Which two statements about iterative and incremental development are true? Select two answers.

  • Iterative development refines the whole program through repeated build-test-improve cycles

  • Iterative development means adding features one at a time

  • A program can only ever use one of the two, never both

  • Incremental development adds new functionality one testable piece at a time

12
1 point

What is the main goal of requirements gathering?

  • To advertise the finished program to users

  • To write the final program code

  • To fix bugs after the program is released

  • To understand what users need before development begins

13
1 point

A developer watches shoppers use a self-checkout machine and notes where they hesitate or make mistakes. Which requirements-gathering method is this?

  • Observation

  • Survey

  • Interview

  • Brainstorming

14
1 point

What is the difference between a program's specification and its plan?

  • The specification defines how the program is built; the plan defines what it must do

  • The specification defines what the program must do; the plan defines how and when it will be built

  • They are two names for the same document

  • The specification is the code; the plan is the comments

15
1 point

Before coding a shopping app, a designer sketches each screen the user will move through, from the main menu to the checkout. Which design activity is this?

  • Brainstorming

  • Modularity

  • Storyboarding

  • Debugging

16
1 point

Which of the following is a design activity carried out before writing code?

  • Releasing the app to users

  • Running test cases on the finished program

  • Fixing a syntax error reported by the editor

  • Drawing a diagram of how data will flow through the program

17
1 point

What happens to comments when a program is executed?

  • They are ignored by the computer

  • They are displayed to the user

  • They make the program run faster

  • They are converted into executable code

18
1 point

Why is it important to keep a program's documentation up to date?

  • Documentation determines how fast the program runs

  • Outdated documentation can mislead developers more than having none at all

  • A program will not run unless its comments are current

  • Up-to-date documentation removes all bugs from the program

19
1 point

A program works correctly on a modern desktop but fails on an older phone that has very little available memory. This is best described as:

  • A logic error

  • A syntax error

  • An environment limitation

  • Missing code attribution

20
1 point

What is code attribution?

  • Testing code with boundary inputs

  • Rewriting code so that it runs faster

  • Deleting any code that is no longer used

  • Acknowledging the original author or source of code that has been reused or adapted

21
1 point

A student finds a function in an online tutorial and changes several of its lines before adding it to their project. Do they need to attribute it?

  • Yes — attribution is required even when the code has been modified

  • No — modifying the code makes it entirely their own

  • No — only exact copies of code need attribution

  • No — code found online is always free to use without credit

22
1 point

Which two pieces of information should a complete code attribution include? Select two answers.

  • The program's expected output

  • The name of the original author

  • The source or location where the code was found

  • The number of lines that were reused

23
1 point

A team builds a first working version of a weather app, tests it with users, uses the feedback to redesign parts of it, then builds an improved version, repeating this process several times. Compared with building the entire finished app in a single pass, what is the main advantage of this iterative approach?

  • The final program is guaranteed to contain no errors

  • The program will always be completed faster than with any other approach

  • Errors and design problems are found early, reducing the cost of fixing them later

  • Requirements no longer need to be investigated before coding begins

24
1 point

A team has finished investigating its users and has written a specification listing everything their app must do. In the design phase that follows, what is the team's main task?

  • Deciding how the program will be structured to meet the specification

  • Deciding what features users want the program to have

  • Writing and debugging the final program code

  • Advertising the completed program to potential users

25
1 point

A programmer reuses a function from an open-source library in a project. Where should the attribution for that code normally be placed?

  • Only in a separate document that the program's users never see

  • In the program's on-screen output each time it runs

  • It does not need attribution as long as the library is open-source

  • In a comment within the code, near the section that was reused