AP Computer Science Principles Practice Quiz: Program Function and Purpose
Written by AP Content Team, Verified for 2026 AP Exams, Last updated: May 2026
Test your understanding with short quizzes. This quiz has 16 questions to check your progress.
Question 1 of 16
All Questions (16)
A) To process data as quickly as possible.
B) To solve problems or to pursue interests through creative expression.
C) To replace human jobs with automated software.
D) To create a universal standard for all software.
Correct Answer: B
Content point 5 explicitly states, 'The purpose of computing innovations is to solve problems or to pursue interests through creative expression.' The other options are not mentioned as the primary purpose.
A) A piece of hardware that executes instructions.
B) A collection of program statements that performs a specific task when run by a computer.
C) A single line of code that is part of a larger software application.
D) Any data sent from a program to a device, such as text or audio.
Correct Answer: B
Content point 7 defines a program as 'a collection of program statements that performs a specific task when run by a computer.' Option C describes a code segment, and Option D describes output.
A) The number of lines of code in the program.
B) How the program's statements are written and organized.
C) How a program functions during execution, often described by user interaction.
D) The intended purpose of the computing innovation.
Correct Answer: C
Content point 10 states, 'The behavior of a program is how a program functions during execution and is often described by how a user interacts with it.'
A) Only from a user's keyboard.
B) Only from other programs.
C) From a user or from other programs.
D) Only from the computer's internal memory.
Correct Answer: C
Content point 17 clearly states, 'Input can come from a user or other programs.' This makes the other options, which are more restrictive, incorrect.
A) A strict, sequential flow of control from the first line of code to the last.
B) The speed of the computer's processor.
C) The execution is triggered by actions like a mouse click or a key press.
D) The program statements are executed in a random order.
Correct Answer: C
Content point 16 explains, 'In event-driven programming, program statements are executed when triggered rather than through the sequential flow of control.' Point 14 gives examples of triggers, such as a mouse click or key press.
A) They are two terms for the same thing.
B) A program is a collection of one or more code segments.
C) A code segment is a collection of one or more programs.
D) A program is software, while a code segment is hardware.
Correct Answer: B
Content point 8 defines a code segment as 'a collection of program statements that is part of a program.' This implies that a program is the larger entity containing code segments.
A) The user entering the interest rate.
B) The calculation of the payment.
C) The displayed monthly payment.
D) The action of clicking the 'calculate' button.
Correct Answer: C
Content point 18 defines program output as 'any data sent from a program to a device.' In this scenario, the displayed monthly payment is the data being sent from the program to the user's screen (a device). The user's entries are inputs, and the button click is an event.
A) The programming language it was written in.
B) The developer's understanding of its purpose.
C) The program's inputs or its prior state.
D) The speed of the device running the program.
Correct Answer: C
Content point 19 states, 'Program output is usually based on a program’s input or prior state (e.g., internal values).'
A) Tactile, audio, visual, text.
B) Audio, visual, network, electrical.
C) Text, tactile, memory, software.
D) Visual, audio, sequential, triggered.
Correct Answer: A
Content point 12 lists the forms of input as 'tactile, audio, visual, or text.' The other options include terms not mentioned in the text as forms of input.
A) It guarantees the resulting program will be free of errors.
B) It provides them with an improved ability to develop that innovation.
C) It allows them to choose the correct hardware for the program.
D) It ensures the program will be popular with users.
Correct Answer: B
Content point 6 directly states, 'An understanding of the purpose of a computing innovation provides developers with an improved ability to develop that computing innovation.'
A) An error or crash that occurs during program execution.
B) The final output produced by a program.
C) An action, like a key press, that supplies input data to a program.
D) A detailed description of what a program does.
Correct Answer: C
Content point 13 defines an event: 'An event is associated with an action and supplies input data to a program.' Point 14 provides examples like a key press or mouse click.
A) The name of the lead developer.
B) How the program statements accomplish the filtering function.
C) The price of the software.
D) A list of all possible inputs.
Correct Answer: B
Content point 11 notes that a program can be described broadly by what it does, 'or in more detail by both what the program does and how the program statements accomplish this function.'
A) A program only needs to work for one specific input.
B) A program needs to work for a variety of inputs and situations.
C) A program's output should always be text-based.
D) A program must be written as a single, continuous code segment.
Correct Answer: B
Content point 9 states, 'A program needs to work for a variety of inputs and situations.' This highlights the need for robust and flexible design.
A) A user's mouse click.
B) A prior state of the program.
C) Audio sent from the program to a speaker.
D) A collection of program statements.
Correct Answer: C
Content point 18 lists the forms of program output as 'tactile, audio, visual, or text.' Audio sent to a speaker fits this description. A mouse click is an input/event, a prior state influences output, and a collection of statements is a program or code segment.
A) The program continuously runs a 'jump' command in a loop, waiting for the spacebar to be pressed.
B) Pressing the spacebar triggers the execution of the program statements responsible for the jump action.
C) The program must finish all other sequential tasks before it can process the spacebar input.
D) The jump action is an output, and pressing the spacebar is the program's prior state.
Correct Answer: B
This scenario is a classic example of event-driven programming. According to points 14 and 16, pressing a key (the spacebar) is an event that 'triggers' the execution of specific program statements (the jump code) rather than following a purely sequential flow.
A) Hardware
B) Input
C) Event
D) Software
Correct Answer: D
Content point 7 explicitly states, 'A program is often referred to as software.'