AtlasLog masuk
Black FridayHalf off Premium, through Sunday, Nov 29.See plans
AP Computer Science Principles · Unit test

Creative development practice test

Up to 15 AP Computer Science Principles questions on creative development, timed at the exam's pace and scored, new every time. Try 3 below first.

Take the creative development unit test →Try 3 questions

Creative development is 10%–13% of the AP Computer Science Principles exam's multiple choice. Learn it first in the creative development chapter.

3 free creative development practice questions

Real questions from the Atlas AP Computer Science Principles exam pool, with the answer and the working.

  1. A student writing a quiz program first writes and tests a procedure that displays one question and checks the answer. Only after it works does she write a procedure that keeps score, and test the two together. Then she adds a procedure that chooses questions at random and tests again. Which of the following best describes her approach?

    1. AA process in which testing waits until the whole program is written, so that all the pieces are tested together.
    2. BAn incremental development process: the program is built in small pieces, and each piece is made to work before it is added to the whole.
    3. CA collaborative process, because the program is made of more than one procedure.
    4. DA process that does not need program requirements, because each piece is tested as it is written.
    Show the answer

    B.

    Breaking the problem into pieces and making sure each one works before adding it is incremental development.

    She tests each piece as it is added, not only at the end; using several procedures is not collaboration, which means working with other people; and testing does not replace knowing what the program is supposed to do.

  2. The procedure countAbove(list, target) is intended to return the number of elements in list that are greater than target.

    PROCEDURE countAbove(list, target)
    {
      count ← 0
      FOR EACH item IN list
      {
        IF(item ≥ target)
        {
          count ← count + 1
        }
      }
      RETURN(count)
    }

    Which of the following procedure calls can be used to show that the procedure does not work as intended?

    1. AcountAbove([2, 9, 4], 5)
    2. BcountAbove([6, 8, 1], 3)
    3. CcountAbove([3, 7, 5], 5)
    4. DcountAbove([1, 2, 3], 4)
    Show the answer

    C.

    The procedure counts elements that are greater than or equal to target, so it gives a wrong answer only when an element equals target. In countAbove([3, 7, 5], 5) the 5 is counted, so it returns 2 instead of 1.

    The other calls have no element equal to the target, so ≥ and > agree and each returns the intended count (1, 2 and 0): passing those tests does not show the error.

  3. A program is intended to display the average of the numbers in a list. For the list [4, 8, 6], the program runs to completion without stopping and displays 4.5 instead of 6. Which of the following best describes the error?

    1. AA syntax error: the program does not follow the rules of the programming language.
    2. BA run-time error: the program stops with an error while it is running.
    3. CAn overflow error: a number in the program is too large for the bits used to store it.
    4. DA logic error: the program runs, but its algorithm produces an incorrect result.
    Show the answer

    D.

    The program runs and produces output, but the output is wrong (4.5 = 18 ÷ 4, so it probably divides by one more than the length): a mistake in the algorithm that makes it behave incorrectly is a logic error.

    A syntax error would keep the program from running at all; a run-time error happens while the program runs and stops it; 4, 8 and 6 are far too small to overflow.

Take the full unit test →AP Computer Science Principles practice exam

Questions people ask

What is in the AP Computer Science Principles Creative development practice test?
Up to 15 multiple-choice questions from this unit, plus a free-response question when the unit has one, timed at the real exam's pace and scored as a percent. The questions are new every time, drawn from a pool of checked questions.
How much of the AP Computer Science Principles exam is Creative development?
10% to 13% of the multiple-choice questions, by the College Board’s course and exam description.
Is it free?
The 3 questions on this page need no account. With a free Atlas account your first unit test is free; Atlas Premium has no limit.

Other AP Computer Science Principles units