HiT - Quiz 2

HiT - Quiz 2

Professional Development

26 Qs

quiz-placeholder

Similar activities

Evaluación teórica: CSS

Evaluación teórica: CSS

11th Grade

22 Qs

python-2

python-2

University

23 Qs

representing numbers (lesson 1 plenary)

representing numbers (lesson 1 plenary)

6th Grade - University

22 Qs

คัมภีร์การเขียนโปรแกรม

คัมภีร์การเขียนโปรแกรม

1st - 2nd Grade

21 Qs

AI/ML MASTERMIND

AI/ML MASTERMIND

University

21 Qs

Print, Input, Subroutines, Selection

Print, Input, Subroutines, Selection

10th - 11th Grade

22 Qs

quizname = str(Data Representation)

quizname = str(Data Representation)

4th - 12th Grade

21 Qs

HiT - Quiz 2

HiT - Quiz 2

Assessment

Quiz

Computers

Professional Development

Practice Problem

Medium

Created by

Venkatesh iGen

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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

26 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

int len = "jump it!".length();


What is the value of len?

8

7

9

6

This code does not compile.

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

String s = "whatever".substring(1,4);


What is the value of s?

"hate"

"hat"

"whate"

"what"

StringIndexOutOfBoundsException

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

int p = "Go Paw Patrol!".indexOf("p");


What is the value of p?

0

4

3

-1

This code will not compile.

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

String s = "cool cat".substring(6);


What is the value of s?

"cat"

"at"

"cool c"

This code does not compile.

StringIndexOutOfBoundsException

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

int x = "Mary".compareTo("Molly");

if (x>=0) System.out.print("Yes");

else System.out.print("No");


What is the output?

Yes

No

There is no output.

This code will not compile.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

String s1 = "goat";

String s2 = s1.substring(0,s1.length());

boolean z = s1.equals(s2);


What is the value of z?

true

false

This code will not compile.

StringIndexOutOfBoundsException

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

Which code segment should go in the blank so that count is equal to the number of times "whoa" occurs in str?

str.length() -2

str.length() -4

str.length() - 3

str.length() - 1

str.length()

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?