Back to the full dot-point answer
United StatesComputer ScienceQuick questions
Unit 4: Iteration
Quick questions on Developing algorithms using Strings - AP Computer Science A Unit 4
2short Q&A pairs drawn directly from our worked dot-point answer. For full context and worked exam questions, read the parent dot-point page.
What is q1?Show answer
Write the expression that extracts the character at index i of String s as a one-character String. [1 point]
What is q2?Show answer
Explain why the loop bound should be i < s.length() rather than i <= s.length() when using substring(i, i + 1). [2 points]
Have a question we have not covered?
This dot-point answer is short enough that we have not extracted many short questions yet. Read the full dot-point answer or ask Mo, our study assistant, in the chat for follow ups.