wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

APCSA Unit 3 FQ

Total questions: 21

Worksheet time: 15mins

Name
Class
Date
1.
a)

5

b)

10

c)

10 == 10

d)

true

e)

false

2.
a)

3

b)

5

c)

8

d)

true

e)

false

3.
a)

x = 8 and y = 25

b)

x = 10 and y = 10

c)

x = 10 and y = 30

d)

x = 15 and y = 30

e)

x = 25 and y = 30

4.
a)

x = -1 y = -1

b)

x = 2 y = 1

c)

x = 3 y = 2

d)

x = 4 y = -1

e)

x = 4 y = 3

5.
a)

7

b)

9

c)

14

d)

21

e)

27

6.
a)

20.0

b)

25.0

c)

70.0

d)

75.0

e)

95.0

7.
a)

randomNumber = 0.70;

b)

randomNumber = 0.80;

c)

randomNumber = 0.85;

d)

randomNumber = 0.90;

e)

randomNumber = 1.00;

8.
a)

isLeapYear(1900)

b)

isLeapYear(1984)

c)

isLeapYear(2000)

d)

isLeapYear(2001)

e)

isLeapYear(2010)

9.
a)

degrees = 90;

b)

degrees = 94;

c)

degrees = 95;

d)

degrees = 96;

e)

The code will work as intended for all values of degrees.

10.
a)

choice < 5

b)

choice >= 5 and choice <= 10

c)

choice > 10

d)

choice == 5 or choice == 10

e)

There is no value for choice that will cause the two code segments to produce different output.

11.
a)

The two code segments print the same value only when grade is below 80.

b)

The two code segments print the same value only when grade is 90 or above or grade is below 80.

c)

The two code segments print the same value only when grade is 90 or above.

d)

Both code segments print the same value for all possible values of grade.

e)

The two code segments print different values for all possible values of grade.

12.
a)

I only

b)

II only

c)

III only

d)

I and II only

e)

I, II, and III

13.
a)

First

b)

Second

c)

Third

d)

FirstThird

e)

SecondThird

14.
a)

5

b)

6

c)

9

d)

10

e)

16

15.
a)

a = true, b = true, x = -1

b)

a = true, b = false, x = 3

c)

a = true, b = false, x = 7

d)

a = false, b = true, x = 3

e)

a = false, b = false, x = 11

16.
a)

Expression I and expression II evaluate to different values for all values ofA and B.

b)

Expression I and expression II evaluate to the same value for all values ofA and B.

c)

Expression I and expression II evaluate to the same value only when A and B are the same.

d)

Expression I and expression II evaluate to the same value only when A and B differ.

e)

Expression I and expression II evaluate to the same value whenever A istrue.

17.
a)
b)
c)
d)
e)
18.
a)

boolean b2 = false || (17 % 3 == 2);

b)

boolean b2 = false && (17 % 3 == 2);

c)

boolean b2 = true || (17 % 3 == 1);

d)

boolean b2 = (true || false) && true;

e)

boolean b2 = (true && false) || true;

19.
a)

A

b)

B

c)

C

d)

D

e)

Nothing is printed.

20.
a)

false

false

false

b)

false

false

true

c)

true

false

false

d)

true

false

true

e)

true

true

true

21.
a)

one dot equals two

b)

one dot equals two

one dot equals three

c)

one dot equals three

two equals equals three

d)

one dot equals two

one dot equals three

two equals equals three

e)

Nothing is printed.