Unit 4: Lesson 4 - Algorithms for Strings EXIT SLIP
Quiz by Thanh Le
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Measure skills
from any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
With a free account, teachers can
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
6 questions
Show answers
- Q1What is the common algorithm used in programming to loop through each character of a string?Searching a stringTraversing a stringSorting a stringConcatenating strings30s
- Q2What does the code snippet count the number of times the letter 'e' appears in a string?e appears 3 times.e appears 1 times.e appears 2 times.e appears 0 times.30s
- Q3What does the code snippet do to a given string 'strap'?pastepartsreversesort30s
- Q4What output does the code snippet provide when given the string 'dinosaur'?saurdinosaurdinsasaudisau30s
- Q5What is the purpose of traversing a string in programming?To count the number of characters in a stringTo capitalize all characters in a stringTo reverse the string orderTo loop through each character of the string30s
- Q6What will the code do in the given scenario? String word = 'dinosaur'; for (int i = 0; i < word.length(); i++) { int index = (i + word.length() / 2) % word.length(); System.out.print(word.substring(index, index + 1)); }Output every other character of the word 'dinosaur'Count the number of characters in the word 'dinosaur'Reverse the order of the word 'dinosaur'Only output the first character of the word 'dinosaur'30s