Design and implement an application that simulates binary integers using boolean arrays. Repeatedly (but at least once) execute the following steps:
Array Indices: 0 1 2 3 4 5 6 7 Array Values: true false true false true false true false Binary Counterpart: 01010101
// Import any classes from java.util, as needed public class BinaryWithBooleans { public static void main(String[] args) { } // This may be easier than Math.pow(...) because // you won't have to do any casting. private static long power(long base, long exponent){ if (exponent == 0) return 1; else if (exponent == 1) return base; else{ long median = (exponent % 2 == 0) ? exponent / 2 : (int) Math.ceil(exponent / 2.0); return power(base, median) * power(base, exponent - median); } } }
What type of integer do you want? 1 for byte 2 for short 3 for int Make your choice: 1 You chose...byte 01001010 is 74 Continue (true or false): true What type of integer do you want? 1 for byte 2 for short 3 for int Make your choice: 2 You chose...short 1101101101000111 is -9401 Continue (true or false): true What type of integer do you want? 1 for byte 2 for short 3 for int Make your choice: 3 You chose...int 10011100001101001001000101011011 is -1674276517 Continue (true or false): falseQuestion: How did the process of editing this program go for you? What were your main challenges and how did you overcome them? What did you learn that may be of use as you move along in this class?