Question: Exercise Hex2Bin (Array for Table Lookup): program called Hex2Bin to convert a hexadecimal string into its equivalent binary string. The output shall look like: Enter

Exercise Hex2Bin (Array for Table Lookup): program called Hex2Bin to convert a hexadecimal string into its equivalent binary string. The output shall look like:

Enter a Hexadecimal string: 1abc

The equivalent binary for hexadecimal "1abc" is: 0001 1010 1011 1100

Hints: Use an array of 16 binary Strings corresponding to hexadecimal number '0' to 'F' (or 'f'), as follows:

String[] hexBits = {"0000", "0001", "0010", "0011",

"0100", "0101", "0110", "0111",

"1000", "1001", "1010", "1011",

"1100", "1101", "1110", "1111"};

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 Programming Questions!