entire program. yes/no
Is your response under 200 words?
Development processes are iterative and cyclical in nature and require
students to reflect and improve on what they have created. Examples of
iterative development could include reflection, revision, testing and
refining, and improvements based on feedback.
The incremental and iterative development process does not need to be a
formal method such as waterfall, top-down, bottom-up, agile, and so on.
Response earns the point if it identifies two opportunities, or two
difficulties, or one opportunity and one difficulty and describes how each is
resolved or incorporated.
The following will NOT be awarded a point if:
The process for determining the program idea does No point
not address the development process used to create
the entire program. No point
No point
The response does not indicate iterative No point
development. No point
Refinement and revision are not connected to
feedback, testing, or reflection.
The response only describes the development at
two specific points in time.
The response does not describe how the difficulties
or opportunities were resolved or incorporated.
Response 2c yes/no
yes/no
Selected code segment implements an algorithm yes/no
that includes at least two or more algorithms.
At least one of the included algorithms uses
mathematical or logical concepts.
Explains how one of the included algorithms
functions independently. yes/no
yes/no
Describes what the selected algorithm does in
relation to the overall purpose of the program.
Is your response under 200 words?
The algorithm being described can utilize existing language functionality or
library calls.
Response earns the point even if the algorithm was not newly developed
(i.e., a student’s re-implementation of the algorithm to find the minimum
value).
Mathematical and logical concepts can be a part of the selected algorithm
or part of either of the included algorithms.
Mathematical concepts include mathematical expressions using
arithmetic operators and mathematical functions.
Logical concepts include Boolean algebra and compound expressions.
The following will NOT be awarded a point if:
The selected algorithm consists of a single No point
instruction. No point
No point
The selected algorithm consists solely of library No point
calls to existing language functionality. No point
No point
The selected algorithm does not include
mathematical or logical concepts. No point
The response only describes what the selected
algorithm does without explaining how it does it.
The response does not explicitly address the
program’s purpose.
The code segment consisting of the selected
algorithm is not included in the written responses
section or is not explicitly identified in the
program code section.
The algorithm is not explicitly identified (i.e., the
entire program is selected as an algorithm, without
explicitly identifying the code segment containing
the algorithm).
Response 2d
Explains how the student-developed abstraction yes/no
manages the complexity of the program. yes/no
Is your response under 200 words?
Responses that use existing abstractions to create a new abstraction, such as
creating a list to represent a collection (e.g., a classroom, an inventory),
would earn this point.
The following will NOT be awarded a point if:
The explanation does not apply to the selected No point
abstraction. No point
The abstraction is not explicitly identified (i.e., the
entire program is selected as an abstraction,
without explicitly identifying the code segment
containing the abstraction).
Appendix E
AP COMPUTER SCIENCE PRINCIPLES EXAM
REFERENCE SHEET
As AP Computer Science Principles does not designate any particular programming
language, this reference sheet provides instructions and explanations to help students
understand the format and meaning of the questions they will see on the exam. The
reference sheet includes two programming formats: text based and block based.
Programming instructions use four data types: numbers, strings, lists, and Booleans.
Instructions from any of the following categories may appear on the exam:
Assignment, Display, and Input
Arithmetic Operators and Numeric Procedures
Relational and Boolean Operators
Selection
Iteration
List Operations
Procedures
Robot
Instruction Explanation
Assignment, Display, and Input
Text: Evaluates expression and assigns the
a ← expression result to the variable a.
Block:
Text: Displays the value of expression,
DISPLAY (expression) followed by a space.
Block:
Instruction Explanation
Text: Accepts a value from the user and
INPUT () returns it.
Block:
INPUT
Instruction Explanation
Arithmetic Operators and Numeric Procedures
Text and Block: The arithmetic operators +, -, *, and / are
a+b used to perform arithmetic on a and b.
a-b For example, 3 / 2 evaluates to 1.5.
a*b
a/b
Text and Block: Evaluates to the remainder when a is
a MOD b divided by b. Assume that a and b are
positive integers.
For example, 17 MOD 5 evaluates to 2.
Text: Evaluates to a random integer from a to
b, including a and b.
RANDOM (a, b) For example, RANDOM (1, 3) could
Block: evaluate to 1, 2, or 3.
RANDOM Relational and Boolean Operators
Text and Block: The relational operators =, ≠, >, <, ≥, and
a=b ≤ are used to test the relationship
a≠b between two variables, expressions, or
a>b values.
a<b For example, a = b evaluates to true if a
a≥b and b are equal; otherwise, it evaluates to
a≤b false.
Instruction Explanation
Text: Evaluates to true if condition is false;
NOT condition otherwise evaluates to false.
Block: Evaluates to true if both condition1 and
condition2 are true; otherwise, evaluates
NOT to false.
Text:
condition1 AND condition2 Evaluates to true if condition1 is true or
Block: if condition2 is true or if both condition1
and condition2 are true; otherwise,
AND evaluates to false.
Text:
condition1 OR condition2
Block:
OR
Instruction Explanation
Selection
Instruction Explanation
Text: The code in
IF (condition) block of
{ statements is
<block of statements> executed if the
} Boolean
Block: expression
condition
Text: evaluates to true;
IF (condition) no action is
{ taken if
<first block of statements> condition
} evaluates to
ELSE false.
{
<second block of statements> The code in first
} block of
Block: statements is
executed if the
Boolean
expression
condition
evaluates to true;
otherwise, the
code in second
block of
statements is
executed.
Instruction Explanation
Iteration
The code in
Text: block of
REPEAT n TIMES statements is
{ executed n times.
<block of statements>
} The code in
Block: block of
statements is
Text: repeated until the
REPEAT UNTIL (condition) Boolean
{ expression
<block of statements> condition
} evaluates to true.
Block:
List Operations
For all list operations, if a list index is less than 1 or greater than
the length of the list, an error message is produced and the
program terminates.
Instruction Explanation
Text: Refers to the
list[i] element of list at
Block: index i. The first
element of list is
list at index 1.
Text:
list[i] ← list[j] Assigns the
Block: value of list[j] to
list[i].
Text:
list ← [value1, value2, value3] Assigns value1,
Block: value2, and
value3 to list[1],
Text: list[2], and
FOR EACH item IN list list[3],
{ respectively.
<block of statements>
} The variable
Block: item is assigned
the value of each
element of list
sequentially, in
order from the
first element to
the last element.
The code in
block of
statements is
executed once
for each
assignment of
item.
Instruction Explanation
Text: Any values in
INSERT (list, i, value) list at indices
Block: greater than or
equal to i are
Text: shifted to the
APPEND (list, value) right. The length
Block: of list is
increased by 1,
Text: and value is
REMOVE (list, i) placed at index i
Block: in list.
Text: The length of list
LENGTH (list) is increased by 1,
Block: and value is
placed at the end
LENGTH of list.
Removes the
item at index i in
list and shifts to
the left any
values at indices
greater than i.
The length of list
is decreased by
1.
Evaluates to the
number of
elements in list.
Procedures
Instruction Explanation
Text:
PROCEDURE name (parameter1, parameter2, ...) A procedure,
{ name, takes zero
<instructions> or more
} parameters. The
Block: procedure
contains
programming
instructions.
Text: A procedure,
PROCEDURE name (parameter1, parameter2, ...) name, takes zero
{ or more
<instructions> parameters. The
RETURN (expression) procedure
} contains
Block: programming
instructions and
Robot returns the value
of expression.
The RETURN
statement may
appear at any
point inside the
procedure and
causes an
immediate return
from the
procedure back
to the calling
program.
Instruction Explanation
If the robot attempts to move to a square that is not open or is The robot moves
beyond the edge of the grid, the robot will stay in its current one square
location and the program will terminate. forward in the
direction it is
Text: facing.
MOVE_FORWARD ()
Block:
Text: The robot rotates
ROTATE_LEFT () in place 90
Block: degrees
counterclockwise
Text: (i.e., makes an
ROTATE_RIGHT () in-place left
Block: turn).
Text: The robot rotates
CAN_MOVE (direction) in place 90
Block: degrees
CAN_MOVE clockwise (i.e.,
makes an in-
place right turn).
Evaluates to true
if there is an
open square one
square in the
direction relative
to where the
robot is facing;
otherwise
evaluates to
false. The value
of direction can
be left, right,
forward, or
backward.