Question: Write a program in the High Level Language (HLL: Java, C, C++) of your choice to take a character string representing a binary number, and

Write a program in the High Level Language (HLL: Java, C, C++) of your choice to take a character string representing a binary number, and write out the number in hex. You can assume the characters in the string are either 0 or 1 and the length of the string is some multiple of 4.

For example, in Java: String binary = 0110110101001111, hexchar; int currentposition = 0; for (int count = 0; count < (binary.length() 1); count = count + 4) { System.out.print(hexchar); } System.out.println();

The result should be on the monitor: 6D4F

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!