?

AP® Computer Science Principles

Free Version

Upgrade subject to access all content

Easy

Assignment Statements

APCSP-QVRPLU

Use the following code segment to answer this question.

    x ← a + b
    y ← a - b
    z ← x * y
    z ← z + 1

What will be the value of z at the end of this code segment, given that a is 2 and b is 7?

A

44

B

-44

C

-45

D

-46