Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class AthroughZ {
- /**
- * @ConnorSiebens
- */
- public static void main(String[] args) {
- Scanner keyboard = new Scanner(System.in);
- char[] letters = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','v','w','x','y','z'};
- int i;
- int[] code = new int[20];
- int codes = 0;
- int readCode;
- System.out.println("Type a word using the integer values. -1 to exit.");
- System.out.println("Can't exceed 25, 0=a, 25=z.");
- readCode = keyboard.nextInt();
- while(readCode != -1){
- code[codes++] = readCode;
- System.out.println("Enter your code. -1 to exit");
- System.out.println("Can't exceed 25, 0=a, 25=z.");
- readCode = keyboard.nextInt();
- }
- for (i=0;i<codes;i++){
- System.out.println(letters[code[i]]);
- }
- keyboard.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement