Problem
Write a JAVA program that takes input from the user and allows to convert between binary, decimal, and hexadecimal numbers. The program prints to screen the result. The program must provide a way for the user to choose which conversion they want to perform. The program must also keep running as long as the user wants to do a conversion.
For this program, you will need to:
Store binary and hex numbers into String vars.
Implement 6 different methods: one for each conversion
Use a loop to convert binary to decimal numbers
• String class methods - String class in Java - GeeksforGeeks
• You may consider using the Math.pow() as a helper method to simplify the conversion - Java Math.pow() method with Examples - Javatpoint
Use comparison methods to convert binary to hex and hex to binary numbers by making use of JAVA String class methods to compare two Strings.
• String class methods - String class in Java - GeeksforGeeks
Decide how to implement other conversions (i.e., using switch statements, arrays, loops).
Constraints
For simplicity purposes, the following constraints should be taken into consideration:
Limit for binary digits - 4 (XXXX)
Limit for hex digits - 1 (0-F)
Range for decimal numbers - [0, 15]
Can only use String.compareTo() or String.equals()