Learn Extracted exam questions AP Computer Science Principles 2024 Free Response · Set 1
2024 Free Response · Set 1
Source PDF on the left, extracted YAML on the right. Compare numbering, marks, options and text.
Programs accept input to achieve their intended functionality. Describe at least one valid input to your program and what your program does with that input.
Refer to your Personalized Project Reference when answering this question.
Consider the first iteration statement included in the Procedure section of your Personalized Project Reference. Describe what is being accomplished by the code in the body of the iteration statement.
Consider the procedure identified in part (i) of the Procedure section of your Personalized Project Reference. Write two calls to your procedure that each cause a different code segment in the procedure to execute. Describe the expected behavior of each call. If it is not possible for two calls to your procedure to cause different code segments to execute, explain why this is the case for your procedure.
Suppose another programmer provides you with a procedure called
checkValidity(value)
that returns true if a value passed as an argument is considered valid by the other programmer and returns false otherwise. Using the list identified in the List section of your Personalized Project Reference, explain in detailed steps an algorithm that uses checkValidity to check whether all elements in your list are considered valid by the other programmer. Your explanation must be detailed enough for someone else to write the program code for the algorithm that uses checkValidity.