[FYI: In the AP CSP Pseudocode (coding) language, the left arrow (←) is used as the assignment operator. Not the equal sign (=). Also, the "College Board Pseudocode Interpreter" website is actually NOT connected in any way with the actual College Board.]
AP CSP Pseudocode Sample Code
----------------------------------------------------------
DISPLAY("Selection")
DISPLAY("Enter y for yes or n for no.")
choice ← INPUT()
IF (choice = "y")
{
DISPLAY("YES")
}
DISPLAY("Enter g for GO! or s for STOP!.")
choice ← INPUT()
IF (choice = "g")
{
DISPLAY("GO!")
}
ELSE
{
DISPLAY("STOP!")
}
DISPLAY("Nested Selection")
num1 ← 5
num2 ← 11
IF (num1 = 3)
{
IF (num2 = 7)
{
DISPLAY(num1)
DISPLAY(num2)
}
}
ELSE
{
IF (num2 ≠ 7)
{
DISPLAY(num1)
DISPLAY(num2)
}
}