String Methods and Characters

String Methods and Characters

10th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

HTML & JavaScript Assessment

HTML & JavaScript Assessment

9th - 10th Grade

15 Qs

bài cũ chương 2-11

bài cũ chương 2-11

KG - 10th Grade

10 Qs

Cấu trúc rẽ nhánh

Cấu trúc rẽ nhánh

11th Grade

14 Qs

Вспоминаем условный оператор

Вспоминаем условный оператор

8th - 10th Grade

10 Qs

Java Strings

Java Strings

9th - 12th Grade

12 Qs

C#

C#

11th Grade

10 Qs

CS Academy Unit 3 Review

CS Academy Unit 3 Review

9th - 11th Grade

10 Qs

Tin 11- Bài 6 - Phép toán, biểu thức, câu lệnh gán

Tin 11- Bài 6 - Phép toán, biểu thức, câu lệnh gán

11th Grade

14 Qs

String Methods and Characters

String Methods and Characters

Assessment

Quiz

Computers

10th - 12th Grade

Hard

Created by

Courtney Yatteau

Used 3+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

The following method will return true if and only if:

s starts with two or more of the same characters

s contains two or more of the same characters

s contains two or more of the same character in a row

s ends with two or more of the same characters

s.charAt(0) == s.charAt(1)

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Susan is 5 years older than Matt. Three years from now Susan’s age will be twice Matt’s age. What should be in place of the following condition to solve this problem?

s == (m - 5) && (2 * s + 3) == (m + 3)

(s == m - 5) && (s - 3 == 2 * (m - 3))

(s == (m + 5)) && ((s + 3) == (2 * m + 3))

s == m + 5 && s + 3 == 2 * m + 6

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Assuming that x and y have been declared as valid integer values, which of the following is equivalent to this statement?

(x > 15 && x < 18) && (x > 10)

(y < 20) || (x > 15 && x < 18)

((x > 10) || (x > 15 && x < 18)) || (y < 20)

(x < 10 && y > 20) && (x < 15 || x > 18)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Given the following method declaration, what will redo(82, 3) return?

5

4

6

7

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

"foxtrot".substring(3, 5)

What is returned by the substring above?

tr

xtr

xr

fotot

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

"tictactoe".indexOf( 'e' )

What is returned by indexOf?

7

8

9

10

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What does the following segment of Java code print out?

4.5 5

4.5 4

4.5 4.0

4.5 4.5

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?