9.3. Mirroring Text

What happens if we add the letter to both sides of the new string that we’re making?

Try changing the phrase and see what effects you can generate.

The accumulator doesn’t have to be set to be an empty string. You can put something in the accumulator, and then it will show up in the middle of the mirrored phrase.

Activity: CodeLens 9.3.3 (Char_In_Middle)

Before you keep reading...

Runestone Academy can only continue if we get support from individuals like you. As a student you are well aware of the high cost of textbooks. Our mission is to provide great books to you for free, but we ask that you consider a $10 donation, more if you can or less if $10 is a burden.

<p>The phrase <code>”A but tuba”</code> is a <b>palindrome</b>. The letters are the same forward and backward. The below program generates the output: <code>”abut tub a<=>a but tuba”</code> Put the lines in the right order with the right indentation.</p>

Note

Discuss topics in this section with classmates.

Show Comments
You have attempted 1 of 6 activities on this page