PT Written Response scoring row 5: The algorithm

In the 2022 AP CSP Scoring Guidelines for the PT Written Response, in row 5 (Algorithm Implementation) specifies that the selected algorithm must include: Sequencing, Selection, and Iteration. If a student wishes to implement a two-player game (2 humans or human-vs-computer) the iteration is going to happen in the user-events (mouse clicks probably,) but not through actual iterative statement.

There will probably be iterations somewhere else in the student code, but my hunch is that he most interesting aspect of the program would be the part that responds to the human player’s move, update the game state, and decide on the computer’s next move (if applicable.) And these don’t necessarily include iteration.

So my question to the more experienced teachers:

  1. Should I advise my students not to choose games that depend on the GUI for the iterations?

  2. Can students include two unrelated code segments in 3c, one to that shows iteration and another that shows selection?

This is what I think but I could very well be wrong, if so and someone has a different answer please correct me!:

I believe the iteration that they are referencing is iteration through an iteration structure. Events are not technically iteration structures. Even though the code inside could run more than once, this is not by an iteration structure but based on the events of the user. Same idea as calling a function more than once would not be considered “iteration” even though calling a function more than once would cause the code to run more than once.

I’ll also add that the iteration must be significant, so using a for loop but only running it one time, or having a while loop where the command will never be true or will only be true one time each time the program runs, would not be considered “iteration” as it is trivial and irrelevant use of the structure.

Thank you Yanet for your input, and I agree with all your comments. An iteration must be implemented using an iterative statement and must be essential to the overall functionality of the the app.

I find the requirement that the iteration and decision must be in the same procedure to be limiting as it could rule out some interesting apps. In addition, it requires that the students think about the coding solution before deciding on the idea. It would be hard to teach the students how to reject an idea because the solution won’t satisfy this requirement.

Yes, I do find that the requirements lead to limiting creativity for students. It is quite frustrating but in order for them to score well, they must think about it ahead of time to ensure they have that procedure with those requirements. Many students end up doing basically the same type app where the procedure is a nested for and if which the for loop is a traversal and based on the user selection some part of the list is displayed, its not super creative or interesting… I hope college board changes this in the future to have a bit more lee-way on where the iteration/selection in the program are implemented!