Unit 1: Introduction to Programming

Lab 2: Gossip

1.2.2
AAP-3.A.6
There is nothing exactly like say (gossip) or say (gossip) for (3) secs on the AP Exam because they don't have sprites and speech balloons, but their way of showing this text to the user is
DISPLAY(gossip())
if it's written as text or a white rounded rectangle containing first the word 'DISPLAY' in all caps and then a smaller white rectangle containing the word 'gossip' in lower case if it's shown as blocks.

You won't have to be able to write code in this notation on the AP exam. You just have to be able to read it so you can answer questions about it.

1.2.4
1.2.5
AAP-3.E.1, AAP-3.E.2
The expression pick random (1) to (10) would be written as
RANDOM(1, 10)
or RANDOM(1, 10). Every time you run this code, you will get a different random number between 1 and 10.

Lab 3: Modern Art with Polygons

1.3.4
AAP-3.C.1, AAP-2.K.2
The procedure definition for the custom pinwheel command
pinwheel, branches: (number of branches)
{
    repeat(number of branches)
    {
        move (100) steps
        move (-37) steps
        turn clockwise (360 / number of branches) degrees
    }
}
would be written as
PROCEDURE pinwheel(numberOfBranches)
{
    REPEAT numberOfBranches TIMES
    {
        move(100)
        move(-37)
        turn_clockwise(360 / numberOfBranches)
    }
}
or PROCEDURE pinwheel(numberOfBranches)
{
    REPEAT numberOfBranches TIMES
    {
        move (100)
        move (-37)
        turn_clockwise (360 / numberOfBranches)
    }
}
The procedures
move()
and
turn_clockwise()
aren't built in to the AP's language so they are written in lower case like other programmer-defined procedures.
Notice that the hat block, pinwheel, branches: (number of branches), would be written as
PROCEDURE pinwheel(numberOfBranches)
. The word
PROCEDURE
tells you that that line of the code is like a hat block; the variable name in the parentheses on that line is the input that the procedure takes.
1.3.4
AAP-3.A.5
This instruction setup; pinwheel, branches: (6) size: (80) backup: (20) would be written as
Pinwheel(6, 80, 20)
or a white rounded rectangle containing first the word 'PINWHEEL' in all caps and then a smaller white rectangle containing the inputs '6, 80, 20'.

You may hear people use the term "pseudocode" to refer to this pseudo-language used on the AP CS Principles exam, but it's not pseudocode. Pseudocode isn't a programming language at all, it's the use of normal human language to describe an algorithm.

Lab 5: Follow the Leader

1.5.2
AAP-2.K.3
The language used on the AP Exam doesn't allow spaces in names of inputs (such as number of fish) or in programmer-defined procedures (such as mouse y, which isn't built into their language). So this example translates them to
numFish
and
MouseY()
.
The reason for the
()
or box after
MouseY
is that
MouseY()
is a procedure call even though it doesn't take any inputs.

The script
repeat until (mouse y < 0) {say (number of fish)}
would be written as

REPEAT UNTIL(mouseY() < 0)
{
    DISPLAY(numFish)
}
or a gray rounded rectangle containing all of the following: on the first line, first the words 'REPEAT UNTIL' in all caps and then a smaller gray rounded rectangle containing 'mouseY () < 0' and on the second line, a white rounded rectangle with a smaller white rounded rectangle inside that contains first the word 'DISPLAY' in all caps and then a smaller white rectangle containing 'numFish'

Remember, you don't need to learn to write the made-up language used on the AP exam. You just have to be able to read and answer questions about it.