Design and implement a method that will take any value as String
(even it's a number!) and convert that value to a number in any
base. Use the method;
private static ArrayList convertToBase(String
value, int currentBase, int
targetBase){
// your algorithm
return result; //which is a String array
}
Examples:
convertToBase("10011", 2, 10) should return [1, 9], meaning,
(10011)base2 = (19)base10
convertToBase("100", 10, 8) should return [6, 4]
convertToBase("E12B0", 16, 2) should return
[1,1,1,0,0,0,0,1,0,0,1,0,1,0,1,1,0,0,0,0]
convertToBase("1250", 10, 16) should return [4,...