Menu

[Solved]628 Functions Hw Convert Binary Functions Write Program Takes Positive Integer Input Outpu Q37242392

6.28 (Functions) HW: Convert to binary-functions Write a program that takes in a positive integer as input, and outputs a str

Hello, I need help completing this program in Python.

6.28 (Functions) HW: Convert to binary-functions 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 output x 2 《rena inder is either 0 or 1) x-x2 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 6, the output is: 110 Your program must define and call the following two functions. The function Integer ToBinary should return a string of 1’s and O’s representing the integer in binary (in reverse). The function ReverseString should return a string representing the input string in reverse. def IntegerToBinary(num1) def ReverseString(inputString) Note: This is a lab fram a previous chapter that now requires the use of a function. ACTVTY 6.28.1: (Functions) HW: Convert to binary functions LAB 0/15 main.py Load default template… 1Define your function here 3 if name__ ‘main’: Type your code here. Your code must call the function. Show transcribed image text 6.28 (Functions) HW: Convert to binary-functions 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 output x 2 《rena inder is either 0 or 1) x-x2 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 6, the output is: 110 Your program must define and call the following two functions. The function Integer ToBinary should return a string of 1’s and O’s representing the integer in binary (in reverse). The function ReverseString should return a string representing the input string in reverse. def IntegerToBinary(num1) def ReverseString(inputString) Note: This is a lab fram a previous chapter that now requires the use of a function. ACTVTY 6.28.1: (Functions) HW: Convert to binary functions LAB 0/15 main.py Load default template… 1Define your function here 3 if name__ ‘main’: Type your code here. Your code must call the function.

Expert Answer


Answer to 6.28 (Functions) HW: Convert to binary-functions Write a program that takes in a positive integer as input, and outputs … . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *