import java.io.*; public class program { public static void main (String [] args) throws IOException { BufferedReader myInput = new BufferedReader (new InputStreamReader (System.in));// Buffered Reader reads the number inputed String key [] = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"}; String keyA [] = {"N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A","B","C","D","E","F","G","H","I","J","K","L","M"}; String letter; System.out.println("Enter a phrase:"); String phrase = myInput.readLine(); int y = 0, i = 0; while ( y <= phrase.length()){ letter = Character.toString(phrase.charAt(y)); while(i <= y){ if (letter != key[i]){ keyA [i] = keyA[i]; } i++; } System.out.println(keyA [i]); y++; } } }