Question: Java, finish the recursive function that converts a binary string to decimal, do not change main or function header. public static void main( String[] args
Java, finish the recursive function that converts a binary string to decimal, do not change main or function header.
public static void main( String[] args ) { if( binToDec( "1101100" ) == 108 ) { System.out.println( "binToDec1 is correct!" ); } if( binToDec( "1011101" ) == 93 ) { System.out.println( "binToDec2 is correct!" ); }
}
public static int binToDec( String bin ) {
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
