Enter input as string or int ??
I have discovered this question which I unclear of what the question want for the data type of the input value.
Should we take the input as int and convert it to String based on the question or just take the input as String?
Write a method that parses a binary number into a hex number.
The method header is as follows:
public static String binaryToHex(String binaryValue)
Write a test program that prompts the user to enter a binary number
and displays the corresponding hexadecimal value.
Re: Enter input as string or int ??
Definitely read it in as a String. You should probably check to ensure it is binary (i.e. only has 1's and 0's). And there are methods for doing that. Check out the Integer API.