
apcsa-String
Authored by lin fu
Computers
11th Grade
Used 6+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Consider s1 and s2 are String:
s1 = "aardvark";
s2 = s1.substring(4);
What does s2 get?
dvar
vark
ark
dvark
2.
FILL IN THE BLANK QUESTION
1 min • 10 pts
Assume the following declaration exists:
String qqq = "Haleakala";
What will be output after the statement executed
System.out.println(qqq.substring(5,9));
3.
FILL IN THE BLANK QUESTION
1 min • 10 pts
Assume the following declaration exists:
String qqq = "Haleakala";
int index= qqq.indexOf("leak");
What is the value of index?
4.
FILL IN THE BLANK QUESTION
1 min • 10 pts
Assume the following declaration:
String kkk=“princess”;
String yyy=“princesS”;
int x=kkk.compareTo(yyy);
What is the value of x then?
(tip:返回ascII码差值,小写a是97, 大写A是65)
5.
FILL IN THE BLANK QUESTION
1 min • 10 pts
Suppose:
String name=“Mississippi”;
int length=name.length();
What is the value of length?
6.
FILL IN THE BLANK QUESTION
1 min • 10 pts
What is the index value of character “d” in string “Amanda”?
7.
MULTIPLE CHOICE QUESTION
2 mins • 10 pts
Suppose that strA=”TOMATO”, strB=”tomato”, and strC=”tom”. Given that “A” comes before “a” in dictionary order, which is true?
strA.compareTo(strB)<0 && strB.compareTo(strC)<0
strB.compareTo(strA)<0 || strC.compareTo(strA)<0
strC.compareTo(strA)<0 && strA.compareTo(strB)<0
!(strA.equals(strB)) && strC.compareTo(strB)<0
Answer explanation
D。strB比strC大三,因为多三个字母,如果strB是 tomato22, 那么他比strC大5, 因为多5个字母。反之是-3;
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
Начала программирования на языке Паскаль
Quiz
•
8th - 11th Grade
10 questions
Website Development - Lesson 13 - Retrieval
Quiz
•
11th Grade
10 questions
Pseudocode - OCR ERL
Quiz
•
9th - 12th Grade
10 questions
Python L2
Quiz
•
10th - 11th Grade
10 questions
k10 - bài 17
Quiz
•
11th Grade
10 questions
Conhecimentos prévios em Java
Quiz
•
10th - 12th Grade
13 questions
Functions
Quiz
•
5th Grade - Professio...
15 questions
11° Evaluación bimestral de informática
Quiz
•
11th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade