AP CSA Review Set #1

AP CSA Review Set #1

9th - 12th Grade

37 Qs

quiz-placeholder

Similar activities

ĐỀ CƯƠNG ÔN TẬP CÔNG NGHỆ 4 CUỐI KỲ 2

ĐỀ CƯƠNG ÔN TẬP CÔNG NGHỆ 4 CUỐI KỲ 2

10th Grade

32 Qs

Year nine revision for summer assessment

Year nine revision for summer assessment

9th Grade

36 Qs

PHOTOPEA TEST-补考

PHOTOPEA TEST-补考

11th Grade

42 Qs

Mid Tes HTML Quiz

Mid Tes HTML Quiz

11th Grade

35 Qs

Tin học 11c2

Tin học 11c2

11th Grade

40 Qs

Pemrograman Dasar

Pemrograman Dasar

10th Grade

40 Qs

XII MM [DESAIN MULTIMEDIA INTERAKTIF] PAS

XII MM [DESAIN MULTIMEDIA INTERAKTIF] PAS

12th Grade

40 Qs

Computer Pretest(Arduino)

Computer Pretest(Arduino)

12th Grade

33 Qs

AP CSA Review Set #1

AP CSA Review Set #1

Assessment

Quiz

Computers

9th - 12th Grade

Practice Problem

Medium

Created by

Devon Senneseth

Used 52+ times

FREE Resource

AI

Enhance your content in a minute

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

37 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

15 mins • 1 pt

Given the following code segment, which of the following is true?


String s1 = new String("Hi There");

String s2 = new String("Hi There");

String s3 = s1;


I. (s1 == s2)

II. (s1.equals(s2))

III. (s1 == s3)

IV. (s2.equals(s3))

II and IV

II, III, and IV

I, II, III, IV

II only

IV only

6.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

What does the following code print?


System.out.println("13" + 5 + 3);

21

1353

It will give a run-time error

138

It will give a compile-time error

Check MeCompare me

7.

MULTIPLE CHOICE QUESTION

5 mins • 1 pt

After the following code is executed, which of I, II and/or III will evaluate to true?


String s1 = "xyz";

String s2 = s1;

String s3 = s2;


I. s1.equals(s3)

II. s1 == s2

III. s1 == s3

I, II, III

I only

II only

III only

II and III only

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?