AP Pseudocode Practice Questions


I am having my students taking the AP Pseudocode Practice Questions test found at the end of Unit 5. In preparation for this test, I have looked at other sites for extra practice questions and I found some conflicting answers about how the DISPLAY command works.

In the Code.org test question #7, contained to IF statement that will DISPLAY two statements.
The answer was:
Inside the if.
All done.

Should the answer not be all on one line as shown below since the DISPLAY command displays the value followed by a space.

Inside the if. All done.

I may be splitting hairs but this can be confusing especially when I do not CS background! There should be only one correct answer… so which is it?



I can see how one could justify both answers. The reference sheet does not state that there is a new line for every DISPLAY command. The answer you see in the Code.org materials is similar to how the write(“message”) works in Javascript. I also saw the question in the sample exam in the CED that seemed to indicate that no newline is created. Now, the answer to that question does not depend on knowing the difference but that could be more distracting than intended. All this to say - this is a great question for the College Board teacher forum.

Happy computing,


Thank you so much for your response! I guess my confusion with the questions I found in CodeHS is that both answer choices were given; where each DISPLAY was on a new line and when each DISPLAY was on the same line with a space in between. I actually answered the CodeHS with each on a new line due to the answer given in Code.org but CodeHS put them on the same line.
Just wanted to know how to direct my students! Maybe CodeHS was too specific in looking for something AP questions won’t… I am not sure


The fact is that the Pseudocode is inconsistent I think. Since they don’t specify EITHER a new line character OR a way to concatenate strings it leaves you in limbo and having to make your best guess.

FWIW when constructing the code.org questions we assumed that DISPLAY inserted a newline at the end of the line. But we also assumed that + could be used for string concatenation in some places.



Thank you! I appreciate your input.