Section II practice: Comfortable days

Answer the four prompts about the program below, as you would about your own Create task on exam day. 60 minutes. Short, specific answers that point to the code score best.

0 words
Program design, function and purpose

Describe the purpose of this program and explain how one of its outputs helps it achieve that purpose.

Algorithm development

Describe in detailed steps how the algorithm in countDaysInRange works, so that another programmer could write it without seeing your code.

Errors and testing

Suppose the condition were written t ≥ low OR t ≤ high by mistake. Describe a test case, with specific values, that would reveal the error, and explain why.

Data and procedural abstraction

Suppose the program did not use the list weekTemps and stored the seven temperatures in seven separate variables instead. Explain how the code that finds the highest temperature would have to change.

Frequently asked questions

How should I use this page?

Read the program and its PPR, press Start for a 60-minute timer like the exam, and answer the four prompts. Then press Finish to check your answers against the checklists and the sample answers.

Can I use my own Create task code?

The prompts are written for the sample PPR on this page, but you can practice the same questions on your own program: answer them about your procedure and your list, then check your answers with the same checklists.

Written by CodeUtility in the style of the exam; not College Board questions. AP is a trademark registered by the College Board, which is not affiliated with, and does not endorse, this site.