Skip to content

Instantly share code, notes, and snippets.

@itsJarrett
Created May 22, 2015 04:30
Show Gist options
  • Save itsJarrett/deb5235dab5b1dcc32ad to your computer and use it in GitHub Desktop.
Save itsJarrett/deb5235dab5b1dcc32ad to your computer and use it in GitHub Desktop.
Corresponding Alphabetization
import java.util.Scanner;
public class Main implements Directions {
public static void main(String args[]) {
Scanner s = new Scanner(System.in);
System.out.println("Enter your 3 letter code");
String code = s.nextLine();
char A = code.charAt(0);
char B = code.charAt(1);
char C = code.charAt(2);
A = (char)('Z' - (A - 'A'));
B = (char)('Z' - (B - 'A'));
C = (char)('Z' - (C - 'A'));
System.out.println("Your combination is: " + A + B + C);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment