Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question

Display a given a decimal value in every base from 2 (binary) through 16 (hexadecimal).

Input Format

You will be given a single positive whole decimal number.

Constraints

The number will be between 2 and 2^63-1 (Long.MAX_VALUE)

Output Format

output 15 lines.
One line for each base from 2 through 16.
On each line print the number in base 10 and it's equivalent representation in the base for the line.
Note: the examples will show your output format.

Sample Input 0

16

Sample Output 0

16 in base 10 equals 10000 in base 2.16 in base 10 equals 121 in base 3.16 in base 10 equals 100 in base 4.16 in base 10 equals 31 in base 5.16 in base 10 equals 24 in base 6.16 in base 10 equals 22 in base 7.16 in base 10 equals 20 in base 8.16 in base 10 equals 17 in base 9.16 in base 10 equals 16 in base 10.16 in base 10 equals 15 in base 11.16 in base 10 equals 14 in base 12.16 in base 10 equals 13 in base 13.16 in base 10 equals 12 in base 14.16 in base 10 equals 11 in base 15.16 in base 10 equals 10 in base 16.

Explanation 0

Check with the programmer version of your calculator - The mode that shows the value in several bases.
Note that each line of the output is an english sentence ending with a period. Match the output.

Sample Input 1

63

Sample Output 1

63 in base 10 equals 111111 in base 2.63 in base 10 equals 2100 in base 3.63 in base 10 equals 333 in base 4.63 in base 10 equals 223 in base 5.63 in base 10 equals 143 in base 6.63 in base 10 equals 120 in base 7.63 in base 10 equals 77 in base 8.63 in base 10 equals 70 in base 9.63 in base 10 equals 63 in base 10.63 in base 10 equals 58 in base 11.63 in base 10 equals 53 in base 12.63 in base 10 equals 4B in base 13.63 in base 10 equals 47 in base 14.63 in base 10 equals 43 in base 15.63 in base 10 equals 3F in base 16.

Explanation 1

Note there are no indicators in your output value as to what the base is.
i.e. We output 3F for 63 in base 16. You may have seen a typical notation of 0x3Fh or something similar
Also note that the hexadecimal digits (A-F) are UPPERCASE    

I need code  in java 

Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education