Welcome back! Our next lesson is entirely focused on one problem: encryption.
We're going to modify the normal lesson flow. We'll start with the homework problem at the top. If you'd like to just go at on your own, go for it! And, if you'd like a bit of help, we'll break it down piece-by-piece below.
Let's get to it!
Let's break down this problem into smaller pieces, and spend a few moments just orienting ourselves and figuring out what to do. We won't write test cases yet, and instead save them for the smaller pieces that we're about to create.
Now that we have a sense of what the different pieces are, let's look at one of the core challenges: remapping each character. We'll also write some simple test cases for our helper method.
At this point we've identified how to remap individual characters.
Next we need to review how to break the input
String into individual characters.
Now that we have our building blocks, let's integrate everything together!
If you are enjoying
Strings, rotation, and modular arithmetic, and haven't had enough yet—here is a practice problem that you might enjoy!
Need more practice? Head over to the practice page.