Skip to content

Instantly share code, notes, and snippets.

@parzibyte

parzibyte/use.java

Created Aug 21, 2020
Embed
What would you like to do?
public static void main(String[] args) {
String originalText = "parzibyte.me";
System.out.println("Original text: " + originalText);
String translatedText = textToBinary(originalText);
System.out.println("In binary, it is: " + translatedText);
System.out.println("-----------------");
String binaryText = "1110000 1100001 1110010 1111010 1101001 1100010 1111001 1110100 1100101 101110 1101101 1100101";
System.out.println("Binary: " + binaryText);
String translatedBinary = binaryToText(binaryText);
System.out.println("In english, it is: " + translatedBinary);
String userText = "";
Scanner sc = new Scanner(System.in);
System.out.println("Type some text and I will convert it to binary:");
userText = sc.nextLine();
translatedText = textToBinary(userText);
System.out.println(translatedText);
System.out.println("Typee some text in binary and I will translate it to english: ");
userText = sc.nextLine();
translatedBinary = binaryToText(userText);
System.out.println(translatedBinary);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment