Created
July 20, 2012 16:34
-
-
Save jlmferreira/3151714 to your computer and use it in GitHub Desktop.
The Decoder - Complete program that will correctly decode a set of characters into a valid message. Your program should read a given file of a simple coded set of characters and print the exact message that the characters contain. The code key for this si
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Decoder { | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
Scanner scan = new Scanner(System.in); | |
String code = scan.next(); | |
String tempCode = new String(); | |
int cc; | |
char ccc = 0; | |
for (int i = 0;i<code.length();i++){ | |
cc =Integer.valueOf(code.charAt(i)-7); | |
ccc = (char) cc; | |
tempCode+=ccc; | |
} | |
System.out.print(tempCode); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment