APCSA Unit 2 String Methods

APCSA Unit 2 String Methods

9th - 12th Grade

39 Qs

quiz-placeholder

Similar activities

SDD Data Types

SDD Data Types

12th Grade

40 Qs

STS Ganjil Pemrograman Perangkat Bergerak Kelas XI

STS Ganjil Pemrograman Perangkat Bergerak Kelas XI

11th Grade

40 Qs

PYTHON - SPRAWDZIAN

PYTHON - SPRAWDZIAN

11th Grade

37 Qs

Strings In java

Strings In java

9th - 10th Grade

35 Qs

Mobile CSP - Unit 3 - Vocab

Mobile CSP - Unit 3 - Vocab

10th - 12th Grade

44 Qs

Arrays and ArrayLists in Java

Arrays and ArrayLists in Java

9th - 12th Grade

34 Qs

XI Unit 5: Introduction to Python

XI Unit 5: Introduction to Python

11th Grade

40 Qs

CS.Proficiency.January2024

CS.Proficiency.January2024

12th Grade

37 Qs

APCSA Unit 2 String Methods

APCSA Unit 2 String Methods

Assessment

Quiz

Computers

9th - 12th Grade

Easy

Created by

Sonia Coile

Used 2+ times

FREE Resource

39 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

Choose the line that assigns "love" to str2.

str2 = str.substring(2,6);

str2 = str.substring(2,5);

str2 = str.substring(2);

str2 = str.substring(4);

2.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

Choose the line that assigns "boba." to str2.

str2 = str.substring(7);

str2 = str.substring(7,11);

str2 = str.substring(8,12);

str2 = str.substring(8);

3.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

Choose the line that assigns "I" to str2.

str2 = str.substring(0,1);

str2 = str.substring(1,2);

str2 = str.substring(0);

str2 = str.substring(1);

4.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

What is the output from running this code block?

equals method

== operator

(Nothing)

equals method

== operator

5.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

What is the result of running this code block?

"." is printed.

An exception is thrown.

"America." is printed.

"a" is printed.

6.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

What is the result of running this code block?

"." is printed.

An exception is thrown.

"America." is printed.

"a" is printed.

7.

MULTIPLE SELECT QUESTION

3 mins • 1 pt

Media Image

What method-call below could be used to determine whether str contains the String "States"? Choose all that apply.

str.contains("States")

str.indexOf("States")

str.equals("States")

str.compareTo("States")

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?