Search Header Logo

Chapter 6 Exam

Authored by Sundi Tiller

Computers

9th - 12th Grade

Used 8+ times

Chapter 6 Exam
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about ASCII and Unicode are true?

ASCII is a newer version of Unicode

ASCII is used to represent characters in many languages, while Unicode can only describe a single language

Strings formed from Unicode characters will always take less memory than strings formed from ASCII characters

ASCII uses a single byte to represent 128 English characters, while Unicode uses multiples bytes to represent thousands of characters in many languages

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following conditions would make it impossible for two strings to be considered equal by the String equals() method?

The two strings have the same number of characters, and match exactly, except the capitalization is different.

All of these are true

The two strings have a different number of characters

The two strings have the same number of characters but the contents are different

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following expressions (1, 2, 3, 4) will produce a true result when the input and password string variables contain exactly the same characters?

1. input.equals(password)

2. password.equals(input)

3. input == password

4. password == input

All will produce true

1 and 2 only

1 and 3 only

3 and 4 only

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A user logs in by entering a username and password. If you want to compare the username to a known string value, and don't want capitalization differences to matter, which String method should you use?

equalsIgnoreCase()

compareCase()

compare()

equals()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following expressions should be used to determine if the contents of myString1 are equal to the contents of myString2?

myString1 = myString2

myString2.equals(myString1)

myString1 == myString2

They all work equally well

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A user logs in by entering a username and password. If you want to compare the password to a known string value, and must have an exact match (including capitalization) for a true result, how should you compare those strings?

Use the == equality operator

Use the String equals() method

Use the String equalsIgnoreCase() method

All of these will work

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given the following three string variables, which expression will return true?

String myString1 = "not so loud!";

String myString2 = "NOT SO LOUD!";

String myString3 = "No thanks";

myString3.equalsIgnoreCase("NO THANKS")

They all return true

myString1.equalsIgnoreCase(myString2)

myString2.equalsIgnoreCase(myString1)

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?