Please enable JavaScript to use CodeHS

AP Computer Science A (Mocha)

Lesson 3.8 String Processing

Description

We’ve learned about writing our own methods that take in parameters and return return values. We’ve learned about the relationship between Strings and characters. We’ve learned about using the methods of the String class and the Character class. We’ve learned about looping through the characters of a String using a for loop. It’s time to put that all together to write some methods that perform some advanced manipulation of Strings.


Objective

Students will be able to…

  • Synthesize the skills and concepts from learned in this unit to write methods that perform advanced manipulations on Strings and chars
  • Write out a pseudocode algorithm for a solution before diving in and writing Java code
  • Implement pseudocode solutions in Java
  • Debug their code
  • Explain the common idiom for manipulating a String:
    • Looping over each character
    • Perform some action based on each character
    • Append the resulting character to a result String that starts off as an empty String
    • Return the result String