Question: java please. 2. Using the Scanner class, prompt the user to enter a 4-bit binary number. a. You can assume (for now) that the user
2. Using the Scanner class, prompt the user to enter a 4-bit binary number. a. You can assume (for now) that the user will always enter valid input. 3. Next, using temporary variables if necessary, convert the binary number into its decimal equivalent. a. Remember, the digits of a binary number correspond to a power of 2. b. You will need to isolate each digit of the number (either a 1 or a 0), multiply it by 2 raised to the appropriate power, and add it to a running total (accumulated value) 4. Output the original binary input and the converted value to match the sample output: Enter a binary number (must be 4 bits): 1011 The decimal equivalent of the binary number 1011 is: 11
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
