All 5 CS Principles units
💡
AP Computer Science Principles · Unit 3 of 5

Algorithms & Programming

30–35% of the exam4 lessons · 53 min

What this unit covers

The topics below follow the published CS Principles course framework for Unit 3. This unit is worth 30–35% of the exam, so budget your time against that rather than against how long the unit takes to teach.

VariablesProceduresListsSimulation

Lessons in this unit

Formulas in Unit 3

The MOD operator
a MOD b = the remainder when a is divided by b
Example: 23 MOD 10 = 3. A number n is even exactly when n MOD 2 = 0, and n MOD b = 0 means b divides n evenly.
Defining and calling a procedure
PROCEDURE square(n) { RETURN(n * n) } → result ← square(6) // result = 36
The parameter n receives the argument 6; RETURN sends back 36, which the call stores in result.
AP pseudocode list operations
APPEND(L, v) · INSERT(L, i, v) · REMOVE(L, i) · LENGTH(L) · L[i] (1-indexed)
INSERT and REMOVE shift the positions of later elements. LENGTH gives the current element count. The first element is always L[1].
RANDOM in AP pseudocode
RANDOM(a, b) → a random integer from a to b, inclusive
Every integer in the range is equally likely. RANDOM(1, 6) yields 1, 2, 3, 4, 5, or 6, each with probability 1/6.

What examiners penalize here

Practice CS Principles

Our practice bank is drawn from across the whole course rather than filtered to one unit, which is closer to how the exam asks anyway — it will not tell you which unit a question is testing.

Questions about this unit

How much of the AP Computer Science Principles exam is Unit 3?

Unit 3, Algorithms & Programming, is worth 30–35% of the CS Principles multiple-choice section according to the published course framework. Across all 5 units that makes it one of the heaviest units on the exam, and worth front-loading.

What topics are covered in CS Principles Unit 3?

Algorithms & Programming covers Variables, Procedures, Lists and Simulation.

How should I study CS Principles Unit 3?

Read the 4 lessons below first — about 55 minutes — then work practice questions on these topics. Finish with practice questions and read the explanation for every one you get right by elimination as well as the ones you miss.

All 5 units of AP Computer Science Principles

  1. Unit 1 · Creative Development
  2. Unit 2 · Data
  3. Unit 3 · Algorithms & Programming
  4. Unit 4 · Computer Systems & Networks
  5. Unit 5 · Impact of Computing

Unit names, topics and exam weights follow the published College Board course framework for AP Computer Science Principles. AP® is a trademark registered by the College Board, which does not endorse this site.