AP CS A Unit 3

AP CS A Unit 3

9th - 12th Grade

20 Qs

quiz-placeholder

Similar activities

Python Revision Tour - I

Python Revision Tour - I

12th Grade

15 Qs

VISUAL BASIC 6

VISUAL BASIC 6

9th - 10th Grade

25 Qs

Python-Basic

Python-Basic

3rd Grade - University

15 Qs

Java Conditional Constructs

Java Conditional Constructs

9th - 10th Grade

20 Qs

Test 4 Edhesive Review

Test 4 Edhesive Review

9th - 12th Grade

18 Qs

Java Casting & Booleans

Java Casting & Booleans

10th - 12th Grade

20 Qs

AP Computer Science A Review

AP Computer Science A Review

11th - 12th Grade

20 Qs

C++

C++

11th Grade

20 Qs

AP CS A Unit 3

AP CS A Unit 3

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Abigail Sheridan

Used 16+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

Consider the following code, assuming grade is an int:

Which of the following will always produce the same result as the code above, regardless of the value of grade? (multiple correct answers)

Media Image
Media Image
Media Image

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is output by the following code?

11

15

31

error

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

Consider the following incomplete code segment.

Consider the following potential replacements for /* missing code */ . Which of these replacements will cause

the code segment to always print false ? Assume that Math is imported correctly into our program.

(int)(Math.random() * 10) + 20

(int)(Math.random() * 10) + 25

(int)(Math.random() * 10) + 30

(int)(Math.random() + 30)

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Given the variables, which boolean condition is true?


int a = 10;

int b = 10;

a < b && a == b

a < b && a != b

a > b || a != b

b >= a && a >= b

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

The following if statement tests the snowfall in Alaska during the months of December, January and February.

Assume low represents a threshold determined to be the least amount of snow required to be normal and high

represents a threshold determined to be the most amount of snow required to be normal and snow represents the

amount of snow in inches for that month. All variables are doubles. It could be replaced with:

Media Image
Media Image
Media Image

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

The following truth table matches which boolean condition?

A && ( A || B )

!A && ( A || !B )

A && ( A && B )

A || ( A || B )

7.

MULTIPLE SELECT QUESTION

1 min • 1 pt

Media Image

A weather app records the current temperature to the nearest degree Fahrenheit using an int variable temp.

The app also uses a String variable tempAdj to store an adjective based on the value of temp which will be used

in a short written summary of the current weather. The values of tempAdj are determined as follows:


Which of the following code segments will correctly set the value of tempAdj for any given value of temp? (Multiple correct answers)

Media Image
Media Image
Media Image

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?