placeholder image to represent content

AP CSP: Semester 1 Final Exam

Quiz by Praise

Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

New Quizalize solo game modes
16 questions
Show answers
  • Q1

    After the following code runs, what is the value of z?

    Question Image

    False

    True

    120s
  • Q2

    What is displayed as a result of running this program?

    Question Image

    3 9 

    2 1 4 5

    39 

    12

    21 45

    30s
  • Q3

    The following program asks the user for a multiple of 4 until they correctly input a multiple of 4. What code should be added to lines 3-4 so that there is not an infinite loop?

    Question Image

    if num % 4 == 0: 

               continue

    if num % 4 == 0:

                 exit

    if num % 4 == 0:

              break

    This program will produce an infinite loop regardless of what code is added.

    300s
  • Q4

    Which of the following is NOT a reason why programmers use comments?

    Comments make it easier for programmers to identify what specific blocks of code do.

    Comments enable programmers to write a program in plain English instead of a programming language.

    Comments makes it easier for multiple people to work on a single program.

    Comments enable programmers to plan out their code before actually writing it.

    300s
  • Q5

    What will print to the console when the following program runs?

    Question Image

    False

    0

    True

    Undefined

    120s
  • Q6

    What would be the radius, in pixels, of the circle output from the following code?

    Question Image

    75 pixels

    25 pixels

    12.5 pixels

    50 pixels

    120s
  • Q7

    If the user enters the number ‘5’, what is printed to the console when this program runs?

    Question Image

    50

    5555555555

    10

    5

    300s
  • Q8

    Given the following segment of code, what will the output be?

    DISPLAY(3 * 2 + 4 MOD 5)

    3

    2

    4.8

    10

    300s
  • Q9

    Given the following, what will the output be?

    DISPLAY(4 + 6 / 5)

    2.0

    5

    5.2

    2

    120s
  • Q10

    A student is trying to prompt a user to enter number and then add them to a variable called sumEven, but only if the user enters an even number. For example, if the user enters 4, 5, 6 then sumEven will equal 10.

    Which of the following operators will be most helpful to help accomplish this task?

    /

    -

    MOD

    *

    300s
  • Q11

    Given the following code

    a ← 8

    b ← 3

    ans ← (a + 3 * b) MOD (c + 4)

    Which of the following values for c would result in ans being set to 1

    0

    4

    12

    All of these

    120s
  • Q12

    How many possible values does a boolean have?

    1

    3

    Infinite

    2

    60s
  • Q13

    Which of the following Boolean expressions is equivalent to the expression:

    a AND (b OR c)

    (a AND b) OR (a AND c)

    (a AND b) AND (a AND c)

    (a AND b) OR c

    (b AND c) OR a

    300s
  • Q14

    What is displayed as a result of executing the following program?

    Question Image

    1

    4

    5 4 3 2 1

    0

    5

    300s
  • Q15

    After the following code runs, what is the value of number?

    Question Image

    16

    8

    4

    2

    32

    300s

Teachers give this quiz to your class