Question: Using Java Programming Exercise 3 (24 points): This exercise is the same as the Programming Exercise 3 from the previous module, except that you are
Programming Exercise 3 (24 points): This exercise is the same as the Programming Exercise 3 from the previous module, except that you are no longer allowed to use arithmetic operations such as division (1), multiplication, or modulo (%) to extract the bits. In this exercise use only logic bit-wise operations. Write a program that prompts the user to enter a positive integer n (0 up to 2-1). You must write a function that takes as input n and returns a string s representing the number n in binary. For this assignment, you CANNOT use the arithmetic division by 2 or the modulo operation to convert the number to binary. Your main program must print out s. Example: If the user enters the number 66, your program must print out 1000010. Hints for Programming Exercise3: Hint I: The number n is already in binary inside the memory. All you need is to "extract" or "read" the bits
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
