Functionality Write Java program to convert numbers in one number system to others. Requirement Write Java program to implement functions to: convert binary number to decimal and hexadecimal number...






  1. Functionality


Write Java program to convert numbers in one number system to others.






  1. Requirement



  • Write Java program to implement functions to:



  1. convert binary number to decimal and hexadecimal number

  2. convert decimal number to binary and hexadecimal number

  3. convert hexadecimal number to binary and decimal number


(You
cannot
use any Java build-in functions/methods to perform conversion)



  • The program will repeatedly display the following menu:



  1. Binary to hexadecimal and decimal

  2. Hexadecimal to binary and decimal

  3. Decimal to binary and hexadecimal

  4. Exit


User enters a number (1, or 2, or 3) to select one item from the meu to perform conversion: once a menu item is selected, user is prompt to enter a number (in string). If this number is valid, the program will convert it to other 2 number systems. Display these 3 values.


For example, if menu item 1 is selected, user will be prompt to enter a binary number (in
string). This number will be converted to decimal number and hexadecimal number. The following message is displayed:


      Binary number: [binary-number]


      Decimal number: [decimal-number]


      Hexadecimal number: [hexadecimal-number]


After that, the menu will be displayed again, so user can select another item.


If menu item 4 is entered, the program will be terminated.



Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here