Bits n Bytes

Run Settings
LanguageJava
Language Version
Run Command
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner putt = new Scanner(System.in); String Hexedinput; String Hexedmessage=""; String ASCIImessage=""; String Decimessage=""; String Binarmessage =""; 6789i = [] while(putt.hasNextLine()); { hexInput = putt.nextLine(); char hexOutput = (char) Integer.parseInt(hexInput,16); asciiMessage+=hexOutput; int decimalOutput = Integer.parseInt(hexInput,16); decimalMessage+=decimalOutput+" "; int binaryOutput = Integer.parseInt(hexInput,16); binaryMessage+=binaryOutput+" "; hexMessage+=hexInput+" "; } binaryMessage = binaryMessage.replaceAll("0", "0000 "); binaryMessage = binaryMessage.replaceAll("1", "0001 "); binaryMessage = binaryMessage.replaceAll("2", "0010 "); binaryMessage = binaryMessage.replaceAll("3", "0011 "); binaryMessage = binaryMessage.replaceAll("4", "0100 "); binaryMessage = binaryMessage.replaceAll("5", "0101 "); binaryMessage = binaryMessage.replaceAll("6", "0110 "); binaryMessage = binaryMessage.replaceAll("7", "0111 "); binaryMessage = binaryMessage.replaceAll("8", "1000 "); binaryMessage = binaryMessage.replaceAll("9", "1001 "); binaryMessage = binaryMessage.replaceAll("A", "1010 "); binaryMessage = binaryMessage.replaceAll("B", "1011 "); binaryMessage = binaryMessage.replaceAll("C", "1100 "); binaryMessage = binaryMessage.replaceAll("D", "1101 "); binaryMessage = binaryMessage.replaceAll("E", "1110 "); binaryMessage = binaryMessage.replaceAll("F", "1111 "); System.out.println("Hexadecimal Message: "+Hexedmessage); System.out.println("ASCII Conversion: "+ ASCIImessage); System.out.println("Decimal Conversion: "+Decimessage); System.out.println("Binary Conversion: "+Binarmessage); } }
Editor Settings
Theme
Key bindings
Full width
Lines