Write Program Takes Positive Integer Input Outputs String 1 S O S Representing Integer Bin Q43829619
i can not get this code to reverse the output.
Write a program that takes in a positive integer as input, and outputs a string of 1’s and O’s representing the integer in binary. For an integer x, the algorithm is: As long as x is greater than 0 Output x % 2 (remainder is either 0 or 1) x = x / 2 Note: The above algorithm outputs the O’s and 1’s in reverse order. You will need to write a second function to reverse the string. Ex: If the input is: the output is: 110 Your program must define and call the following two methods. The method integerToReverseBinaryO should return a string of 1’s and Os representing the integer in binary (in reverse). The method reverseString() should return a string representing the input string in reverse. public static String integer ToReverseBinary(int integerValue) public static String reverseString(String inputString) Show transcribed image text Write a program that takes in a positive integer as input, and outputs a string of 1’s and O’s representing the integer in binary. For an integer x, the algorithm is: As long as x is greater than 0 Output x % 2 (remainder is either 0 or 1) x = x / 2 Note: The above algorithm outputs the O’s and 1’s in reverse order. You will need to write a second function to reverse the string. Ex: If the input is: the output is: 110 Your program must define and call the following two methods. The method integerToReverseBinaryO should return a string of 1’s and Os representing the integer in binary (in reverse). The method reverseString() should return a string representing the input string in reverse. public static String integer ToReverseBinary(int integerValue) public static String reverseString(String inputString)
Expert Answer
Answer to i can not get this code to reverse the output. …
OR