What does a program do, who is it for, and how do inputs, outputs and behavior define its purpose?
Topic 1.2 Program Function and Purpose: a program is a sequence of instructions that accomplishes a goal; programs receive input, produce output, and their behavior is shaped by purpose and intended users.
A focused answer to AP CSP Topic 1.2, covering what a program is, function versus purpose, the input-process-output model, event-driven programs, program behavior and intended users, and how the Create task asks you to describe your program's purpose and function.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this topic is asking
The College Board (Topic 1.2) wants you to describe what a program does and why. A program is a sequence of instructions that accomplishes a goal. Its purpose is the problem it solves or the need it meets; its function is how it behaves, including the inputs it receives and the outputs it produces. You must be able to identify input and output, recognize that some programs respond to events, and describe your own program's purpose and function in the Create performance task.
What a program is
Purpose versus function
These two words are easy to confuse, and the exam tests the distinction:
- Purpose is the reason the program exists: the problem it solves or the need it serves, and who the intended users are. Example: "to help students track study hours so they notice when they fall behind".
- Function is the program's behavior: what it actually does when run, including the inputs it takes and the outputs it gives. Example: "the user enters daily study hours and the program displays a running weekly total".
Input, process, output
Identifying input and output is a recurring multiple-choice skill. For a weather app, the input is the city the user enters and the output is the temperature displayed.
Event-driven programs
Not every program runs top to bottom once. Many are event driven: certain instructions run in response to an event, such as a button click, a key press, a screen tap, or data arriving. The program waits for events and reacts. Knowing this explains how interactive apps behave.
Try this
Q1. A program reads a temperature from a sensor and turns on a fan when it is too hot. State the input and the output. [2 points]
- Cue. Input: the temperature reading from the sensor. Output: turning the fan on (a physical action / signal).
Q2. Explain the difference between a program's purpose and its function. [2 points]
- Cue. Purpose is the problem it solves and who it is for; function is what it actually does when run, including its inputs and outputs.
Exam-style practice questions
Practice questions written in the style of College Board exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
AP 2021 (style)1 marksMultiple choice. A program lets a user enter a city name and displays the current temperature there. Which of the following correctly identifies the program's input and output?
(A) Input: the temperature; Output: the city name.
(B) Input: the city name; Output: the temperature.
(C) Input and output are both the temperature.
(D) The program has no input because it runs automatically.
Show worked answer →
The answer is (B).
The input is the data the program receives from the user or environment: here, the city name the user enters. The output is what the program produces: the temperature it displays. (A) reverses them. (C) ignores the user-supplied city. (D) is wrong: the user provides input by entering a city.
Markers reward correctly applying the input-process-output model: input is received, output is produced.
AP 2023 (style)3 marksCreate performance task (style). Write two to three sentences describing the purpose and function of a program you built. Make the purpose (the problem it solves) and the function (how a user interacts with it, including at least one input and one output) both clear.
Show worked answer →
A strong response separates purpose from function and names input and output.
Model response: "The purpose of my program is to help students track how many hours they study each week so they can spot when they are falling behind. The user inputs the number of hours studied for a day, and the program adds it to a running total and displays the weekly total along with a message if the total is below the user's goal."
This earns credit because it states the purpose (helping students track study hours), describes the function (the user enters daily hours), and identifies an input (hours studied) and an output (the weekly total and message). A response that only says "my program is about studying" describes neither function nor input/output and would not score.
Related dot points
- Topic 1.1 Collaboration: collaboration produces a program that reflects diverse perspectives, and effective collaboration uses defined roles, consensus building and tools such as pair programming.
A focused answer to AP CSP Topic 1.1, covering why collaboration improves a program, the inclusion of diverse perspectives, consensus building, communication and conflict resolution, pair programming, and how the Create performance task asks you to describe collaboration.
- Topic 1.3 Program Design and Development: programs are developed iteratively through investigating, designing, prototyping and testing, using tools such as program requirements, specifications and feedback.
A focused answer to AP CSP Topic 1.3, covering the iterative development process, investigating and reflecting, program requirements and specifications, designing and prototyping, the role of user feedback, and how the Create task documents the development process.
- Topic 1.4 Identifying and Correcting Errors: programs contain logic, syntax, runtime and overflow errors, and programmers find and fix them by testing with carefully chosen inputs and debugging.
A focused answer to AP CSP Topic 1.4, covering logic, syntax, runtime and overflow errors, testing with chosen inputs including edge cases, debugging strategies such as tracing and adding display statements, and how to describe testing in the Create task.
- Topic 3.1 Variables and Assignments: a variable is a named reference to a stored value, and the assignment operator stores the value of an expression into a variable.
A focused answer to AP CSP Topics 3.1 to 3.3, covering variables as named storage, the assignment operator (the arrow) in AP CSP pseudocode, evaluating the right side first, updating variables, data types, and tracing assignment statements.
- Topic 2.4 Using Programs with Data: programs process large data sets through cleaning, filtering, classifying and transforming data, often using lists and iteration to scale to large amounts of data.
A focused answer to AP CSP Topic 2.4, covering why programs are essential for large data sets, cleaning and classifying data, filtering with conditionals, using lists and iteration to process data at scale, and visualizing results, with worked pseudocode.
Sources & how we know this
- AP Computer Science Principles Course and Exam Description — College Board (2025)