AP CSA Conditionals

AP CSA Conditionals

10th - 12th Grade

20 Qs

quiz-placeholder

Similar activities

Teknik Pengolahan Audio dan Video

Teknik Pengolahan Audio dan Video

12th Grade

20 Qs

Informatika

Informatika

10th Grade

20 Qs

Y10M2A2 - Selection

Y10M2A2 - Selection

6th - 10th Grade

15 Qs

CSS - Computer Systems Services

CSS - Computer Systems Services

12th Grade

20 Qs

Remidi XI TKJ2 UH 2 Teknologi Jaringan WAN

Remidi XI TKJ2 UH 2 Teknologi Jaringan WAN

11th Grade

20 Qs

Hardware and Components

Hardware and Components

5th - 11th Grade

19 Qs

Vocabulary of Computer

Vocabulary of Computer

12th Grade

15 Qs

Bài 11. Tệp và quản lý tệp

Bài 11. Tệp và quản lý tệp

10th Grade

20 Qs

AP CSA Conditionals

AP CSA Conditionals

Assessment

Quiz

Computers

10th - 12th Grade

Hard

Created by

Garret Andreasen

Used 7+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

5-1-1: What is the value of grade when the following code executes and score is 93?
if (score >= 90) grade = "A"; if (score >= 80) grade = "B"; if (score >= 70) grade = "C"; if (score >= 60) grade = "D"; else grade = "E";

A
B
C
D

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is equivalent to the code segment below?
if (x > 2) x = x * 2; if (x > 4) x = 0;

 x = 0;
if (x > 2) x *= 2;
if (x > 2) x = 0;
 if (x > 2) x = 0; else x *= 2;

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following code print when x has been set to -5?
if (x < 0) System.out.println("x is negative"); else if (x == 0) System.out.println("x is zero"); else System.out.println("x is positive"); 

 x is negative
x is zero
x is positive

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following code print when x has been set to 2000?
if (x < 0) System.out.println("x is negative"); else if (x == 0) System.out.println("x is zero"); else System.out.println("x is positive"); 

x is negative
 is zero
x is positive

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following code print when x has been set to .8?
if (x < .25) System.out.println("first quartile"); else if (x < .5) System.out.println("second quartile"); else if (x < .75) System.out.println("third quartile"); else System.out.println("fourth quartile"); 

first quartile
second quartile
third quartile
fourth quartile

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is printed when the following code executes and x has been set to zero?
if (x > 0 && (y / x) == 3) System.out.println("first case"); else System.out.println("second case"); 

first case
second case
You will get a error because you can't divide by zero.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is printed when the following code executes and x has been set to zero?
if (x > 0 || (y / x) == 3) System.out.println("first case"); else System.out.println("second case"); 

first case
second case
You will get a error because you can't divide by zero.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?