- Joined
- Mar 18, 2018
- Posts
- 653
- Reaction
- 666
- Points
- 357
Please nasa pic po hehe need code
Attachments
-
You do not have permission to view the full content of this post. Log in or register now.
Maraming salamat papsInisang Class ko nalang sya
import java.util.Scanner;
public class AssciiCoding {
public static void main (String args []) {
Scanner sc = new Scanner(System.in);
System.out.println("Binary into Characters");
System.out.print("Enter Binary:");
String binary = sc.nextLine();
//Binary to Character
int br = Integer.parseInt(binary,2);
char ch = (char)br;
System.out.println("Character with Binary code "+binary+" is "+ch);
//Character to ASCII
int ascii = (int)ch;
System.out.println("ASCII code of character "+ch+" is "+ascii);
//ASCII to Binary
String fBr = Integer.toBinaryString(ascii);
System.out.println("Binary code of ASCII code "+ascii+" is "+fBr);
}
}
View attachment 543200
Maraming salamat paps