
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Java - Convert to Reverse Binary
![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 reverse 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 0's and 1's in reverse order.
Ex: If the input is:
6
the output is:
011
6 in binary is 110; the algorithm outputs the bits in reverse.
1 import java.util.Scanner;
NM i 600
2
3 public class LabProgram {
4
5
public static void main(String[] args) {
/* Type your code here. */
}
7}
8](https://content.bartleby.com/qna-images/question/eee5b789-dad3-4756-bf58-2fa8d5139a3e/c7840f2e-29ae-4054-8fe0-239f6ff68cfc/it1uijs_thumbnail.png)
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 reverse 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 0's and 1's in reverse order.
Ex: If the input is:
6
the output is:
011
6 in binary is 110; the algorithm outputs the bits in reverse.
1 import java.util.Scanner;
NM i 600
2
3 public class LabProgram {
4
5
public static void main(String[] args) {
/* Type your code here. */
}
7}
8
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Describe the disadvantages and advantages of the binary-coded-decimal (BCD) rep- resentation. Describe the advantages of the two's complement scheme.arrow_forwardBriefly explain binary multiplicationarrow_forwardCompute floating-point addition(binary)and multiplication(binary) for the following inputs 1.100 x 24 and 0.011x 25arrow_forward
- 1. Convert 1337g to decimal (base 10) Use sum of expansion of products (don't skip steps!)arrow_forwardIn single precision (IEEE-754 standard), 8 bits are used for storing the exponent (the bias is 127), and 23 bits are used for storing the mantissa. (a) What are the smallest and the largest positive numbers that can be stored in single precision? (b) What is the smallest value of the mantissa that can be stored?arrow_forwardplease answer the follwoing question regarding assemlyarrow_forward
- with a detailed step-by-step process, convert the following decimal numbers into binary, IEEE 754 and hexadecimal formats. i) -142.62 ii) 1/(2.25).arrow_forwardjust convert to binary, don't bother with hexarrow_forwardCompute floating-point addition(binary)and multiplication(binary) for the following inputs 1.001 x 2-4 and 1.010 x 2-5arrow_forward
- -128 64 32 -128 1 -128 64 32 0 0 -120--128 16 -128 64 32 1 0 0 (a) An eight-position two's complement value box 16 0 8 16 0 4 8 0 4 0 2 (b) Convert binary 10000011 to decimal 4 0 2 1 +2 2 0 1 8 1 +8 (c) Convert decimal -120 to binary 1 1 +1=-125 1 0arrow_forwardBriefly explain bitwise multiplicationarrow_forwardConvert the following expressions from reverse Polish notation to infix notation. U V W X Y Z + * - * - X Y Z + V W – * Z - + X Z + W / X Z - W / - Show details of conversionarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education