Fiveable

⌨️AP Computer Science Principles Unit 3 Review

QR code for AP Computer Science Principles practice questions

3.13 Developing Procedures

3.13 Developing Procedures

Written by the Fiveable Content Team • Last updated June 2026
Verified for the 2027 exam
Verified for the 2027 examWritten by the Fiveable Content Team • Last updated June 2026
⌨️AP Computer Science Principles
Unit & Topic Study Guides

AP Computer Science Principles Exam

Pep mascot

Developing procedures means writing named blocks of code that solve one part of a problem, making the program easier to reuse, test, and organize. This is procedural abstraction: you can use a procedure by knowing what it does without needing every internal detail. For AP Computer Science Principles, connect procedures, parameters, return values, and modularity to managing program complexity.

Why This Matters for the AP Computer Science Principles Exam

Procedures show up in two big places in AP Computer Science Principles. On the multiple-choice section, you will read procedure definitions, trace what they return, and explain how breaking a program into procedures manages complexity. For the Create performance task, you build your own program, and a student-developed procedure with a parameter that helps your program work is part of what you document and explain.

You should be comfortable writing procedure definitions in exam pseudocode, predicting return values, and explaining in plain language why a procedure makes a program easier to read, reuse, and maintain.

Key Takeaways

  • Procedural abstraction lets you use a procedure by knowing what it does, not how it does it.
  • Procedures break a big problem into smaller subproblems you solve one at a time.
  • Splitting a program into separate subprograms is called modularity.
  • Parameters generalize a procedure so the same code works with many different inputs, which means less duplicated code.
  • A RETURN statement can appear anywhere in a procedure and immediately sends control back to where the procedure was called.
  • You can change the inside of a procedure without breaking the rest of the program, as long as what it does stays the same.

What Procedural Abstraction Is

A procedure is a named group of instructions. Procedural abstraction means you can call that procedure just by knowing its name and what it does, not the details of how it works. You already use this idea with built-in procedures like DISPLAY. You call it, it shows a value, and you do not have to think about how it puts text on the screen.

This same idea works for procedures you write yourself. Once a procedure has a clear name and job, the rest of your program can use it without dealing with the inner details.

Breaking Problems Into Subproblems

Procedures let you solve a large problem by solving smaller pieces first. A bigger project, like a choose-your-own-adventure story, breaks down into smaller jobs: let the player choose a path, display that choice, and track progress so choices have consequences. Each job can become its own procedure, and you combine them to build the full program.

Dividing a program into separate subprograms like this is called modularity. Modular code is easier to build, test, and fix because each part has one clear purpose.

Cleaner, Reusable Code

Procedures cut down on repeated code and make programs easier to read. Compare these two versions.

Without a procedure:

</>Code
first_number = 7
second_number = 5
sum_value = first_number + second_number
print (sum_value)

first_number = 8
second_number = 2
sum_value = first_number + second_number
print (sum_value)

first_number = 9
second_number = 3
sum_value = first_number + second_number
print (sum_value)

With a procedure:

</>Code
def summing_machine(first_number, second_number):
  sum_value = first_number + second_number
  print (sum_value)

summing_machine(5, 7)
summing_machine(8, 2)
summing_machine(9, 3)

The second version is shorter and clearer, which matters a lot in large programs with hundreds of lines.

The reason this works is parameters. Parameters stand in for general categories of data, like numbers or strings, so one procedure can handle many different inputs. Instead of duplicating the same code for each case, you write it once and call it with different arguments. This is how a procedural abstraction extracts shared features to generalize functionality.

Writing Procedures in Exam Pseudocode

The AP exam reference sheet gives you two patterns for defining procedures.

A procedure that does not return a value:

</>Code
PROCEDURE procName(parameter1, parameter2, ...)
{
  <block of statements>
}

A procedure that returns a value:

</>Code
PROCEDURE procName(parameter1, parameter2, ...)
{
  <block of statements>
  RETURN(expression)
}

To capture a returned value, you assign the call to a variable:

</>Code
result ← procName(arg1, arg2, ...)

A RETURN statement may appear at any point inside the procedure. When it runs, control immediately goes back to where the procedure was called, and the rest of the procedure is skipped.

Changing the Inside Without Breaking Callers

One big benefit of procedural abstraction is flexibility. As long as a procedure keeps doing the same thing, you can change how it works inside to make it faster or use less storage, and you do not have to notify the parts of the program that call it. You can also make a fix once inside the procedure, and that change applies everywhere the procedure is called.

How to Use This on the AP Computer Science Principles Exam

MCQ

  • Read procedure definitions carefully and trace what value a call returns. Watch for an early RETURN that ends the procedure before later statements run.
  • Match parameters to arguments in order: the first argument goes to the first parameter, the second to the second, and so on.
  • Be ready to explain why dividing a program into procedures manages complexity, improves readability, and reduces duplicated code.

Create Performance Task

  • Plan a student-developed procedure that takes a parameter and does meaningful work in your program.
  • Be ready to explain in writing what your procedure does and how it helps your program work, focusing on what it does rather than only how it does it.

Common Trap

  • Do not assume a procedure returns something just because it runs code. A procedure only produces a value the caller can store if it has a RETURN.

Common Misconceptions

  • "You need to know how a procedure works to use it." You only need to know its name, its parameters, and what it does. The internal details are hidden on purpose.
  • "Parameters and arguments are the same thing." Parameters are the input variables listed in the definition. Arguments are the actual values you pass in when you call the procedure.
  • "Every procedure returns a value." Some procedures just perform an action, like displaying output, and do not return anything to store.
  • "Code after a RETURN still runs." Once RETURN executes, control leaves the procedure immediately, so any statements after it are skipped.
  • "Changing the inside of a procedure means you have to update everywhere it is called." As long as what the procedure does stays the same, callers do not need to change.

Vocabulary

The following words are mentioned explicitly in the College Board Course and Exam Description for this topic.

Term

Definition

argument

The actual values passed to a procedure when it is called, which correspond to the procedure's parameters.

code readability

The quality of being easy to understand and follow in a program, which is improved through the use of procedural abstraction.

code reuse

The practice of using existing procedures or code in multiple places within a program to avoid duplication and manage complexity.

modularity

The subdivision of a computer program into separate subprograms or modules to manage complexity.

parameter

Variables in a procedure that allow it to accept different input values, enabling the procedure to be generalized and reused with a range of inputs.

procedural abstraction

A programming technique that provides a name for a process and allows a procedure to be used by knowing what it does without needing to know how it works internally.

procedure

A named block of reusable code that performs a specific task and can be called multiple times throughout a program.

RETURN statement

A statement that causes a procedure to immediately exit and return a value to the calling statement.

subproblems

Smaller, more manageable problems that together form the solution to a larger problem in a program.

Frequently Asked Questions

What is a procedure in AP CSP?

A procedure is a named group of programming instructions that performs a task. In AP CSP, procedures can take parameters, may return a value, and help organize a program into smaller reusable parts.

What is procedural abstraction?

Procedural abstraction means using a procedure by knowing what it does without needing to know every detail of how it works. It manages complexity by hiding implementation details behind a clear procedure name and purpose.

How do parameters make procedures more general?

Parameters let one procedure work with different input values. Instead of copying the same code for every case, you write the procedure once and call it with different arguments.

What does RETURN do in AP CSP pseudocode?

RETURN sends a value back to the statement that called the procedure. In AP CSP pseudocode, a RETURN statement can appear inside a procedure and causes the procedure to finish immediately.

How do procedures manage complexity?

Procedures manage complexity by breaking a large program into smaller subprograms, which is called modularity. They make code easier to read, test, reuse, and change without affecting the rest of the program.

What procedure do I need for the Create performance task?

For the Create performance task, your program should include a student-developed procedure with at least one parameter that contributes to the program’s purpose. You should be able to explain what it does and how it helps manage complexity.

Pep mascot
Upgrade your Fiveable account to print any study guide

Download study guides as beautiful PDFs See example

Print or share PDFs with your students

Always prints our latest, updated content

Mark up and annotate as you study

Click below to go to billing portal → update your plan → choose Yearly→ and select "Fiveable Share Plan". Only pay the difference

Plan is open to all students, teachers, parents, etc
Pep mascot
Upgrade your Fiveable account to export vocabulary

Download study guides as beautiful PDFs See example

Print or share PDFs with your students

Always prints our latest, updated content

Mark up and annotate as you study

Plan is open to all students, teachers, parents, etc
report an error
description

screenshots help us find and fix the issue faster (optional)

add screenshot