Skip to main content

Written Response 1: Program design, function and purpose

Club attendance: testing and revising

  • Units 1 and 3
  • 1 point
  • About 15 minutes

One prompt about the program as a whole: for example, who the program is for and how its design meets that user's needs, what its inputs and outputs are, or what documentation would help another programmer understand a code segment. On the exam: Question 1 of 2 (1 point). Section II has 2 written-response questions (4 prompts) in 60 minutes, taken in Bluebook at the end-of-course exam; no calculator. On the real exam the questions are about your own Create performance task program, and you can see your Personalized Project Reference (screenshots of your procedure and list code). The Create task is 30% of the AP score, scored on 6 one-point rows: video, program requirements, WR1, WR2(a), WR2(b) and WR2(c). On this site you answer the same kinds of prompts about a short sample program given with the question.

The question and its sources

This written-response prompt is about the sample program below. On the exam you answer this kind of prompt about your own Create task program; here, answer about this program and refer to its code. Write in complete sentences.

About the program and its development

A club leader uses this program to take attendance. The leader types each member's name as they arrive and types done when everyone is in. The program counts the names that are on roster and flags any name that isn't.

Development log, test 1 (first version): the first version read names with REPEAT 5 TIMES, one pass for each person on the roster. On a day when only 3 members came, the program kept waiting for two more names and never displayed the count.

Change made after test 1: the loop became REPEAT UNTIL(name = "done"), with one INPUT() before the loop and another at the end of each pass. This is the version shown below.

Development log, test 2 (current version): the leader typed Mei, jordan, Sam, Avery, done. The program displayed Name not on roster: jordan Members present: 3. Jordan is on the roster, but the leader typed a lowercase j.

Source: Sample program written for this practice question (hypothetical)

The procedure

Pseudocode
PROCEDURE onRoster(roster, name)
{
    FOR EACH member IN roster
    {
        IF(member = name)
        {
            RETURN(true)
        }
    }
    RETURN(false)
}

Source: Sample program written for this practice question (hypothetical)

The main program (current version)

Pseudocode
roster ← ["Avery", "Jordan", "Mei", "Sam", "Tariq"]
present ← []
name ← INPUT()
REPEAT UNTIL(name = "done")
{
    IF(onRoster(roster, name))
    {
        APPEND(present, name)
    }
    ELSE
    {
        DISPLAY("Name not on roster:")
        DISPLAY(name)
    }
    name ← INPUT()
}
DISPLAY("Members present:")
DISPLAY(LENGTH(present))

Source: Sample program written for this practice question (hypothetical)

Suggested time: 15 minutes

Your answers are saved in this browser as you type.

Something wrong with this question?

What's wrong?

Please don't include personal details.

Part (a)

1 point

The development log describes two tests. Choose one problem the tests revealed. Describe that problem, and explain how a specific part of the current code either solves it or would need to change to solve it.

0 / 2,500 characters

Checking scoring…

Scoring it yourself shows you the rubric, examples and a model answer. Try writing your answer first.