public class Jibberish { public static void main(String[] args) { StringBuffer text = new StringBuffer(args[0]); toJibberish(text); System.out.print(text); return; } /** * AE: (text != null) & (text.length() > 0) */ public static void toJibberish(StringBuffer text) { for (int i = 0; i < text.length(); i++) switch (text.charAt(i)) { case 'Å': text.setCharAt(i, 'A'); break; case 'å': text.setCharAt(i, 'a'); break; case 'Ä': text.setCharAt(i, 'A'); break; case 'ä': text.setCharAt(i, 'a'); break; case 'Ö': text.setCharAt(i, 'O'); break; case 'ö': text.setCharAt(i, 'o'); break; default: } text = text.reverse(); return; } }