id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

tmhscs@gmail.com monroe > encrypt
prev  |  next  |  chance

Mr. Monroe's CS 1 students are learning about the ASCII chart! They are scheduled to take a test next Friday over the ASCII chart and other fundamental topics. However, his class is full of cheaters! To prevent cheating, Mr. Monroe will encrypt all of the words around his classroom such as those on posters and his smart board. First, Mr. Monroe will mirror the string so that the first and last letters are swapped, the second and second to last letters are swapped, etc. Then, he will perform a Caesar cipher on the mirrored string by shifting all of the characters to the right by 3 (a becomes d, z becomes c, etc). To top it off, Mr. Monroe will reverse the case of each letter in the string (Whether it's uppercase or lowercase). Mr. Monroe's code is bad and won't compile, so help him create an method that will encrypt the words around his classroom.


encrypt("") → ""
encrypt("List list = new ArrayList") → "WVLoBDUUd ZHQ = WVLO WVLo"
encrypt("ASCII Chart") → "WUDKf llfvd"

...Save, Compile, Run (ctrl-enter)

public String encrypt(String str) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 375 Post-solution available

Copyright Nick Parlante 2017 - privacy