Thulasi.md 771B

BinaryConverter

** This program is about converting a given Integer number into a Binary representation of that number. This has two methods. One is toBinary() method which converts the given number into binary representation and the other number is to check if the converted binary number contains all 0s and 1s.

toBinary(int number)---> This method takes the given number and save the boolean value if it is negative or positive. Then it takes the absolute value of that number. Then through the while loop it does the mod and division to convert the given number into binary and returns that value to the method call.

Then we are checking that value with the "Integer.toBinaryString(number)" which is giving the same output as the toBinary() method.