Question
please do it with JAVA Display a prompt asking if the user wishes to convert from decimal, binary, or hexadecimal or if they want to
please do it with JAVA
Display a prompt asking if the user wishes to convert from decimal, binary, or hexadecimal or if they want to quit.
The user will enter D, B, H, or Q . Any other input will display an error message.
The user will then be prompted for a number in their selected base.
The program will then display the number in decimal, hexadecimal, and binary format.
The program will go back to step 1 and start the process all over again, until the user selects quit.
Upon exit, the program will thank the user.
A sample run of this program is below:
Convert from (H)exadecimal, (B)inary, (D)ecimal, or (Q)uit? H Enter Number: DEAD DEC: 57005 HEX: DEAD BIN: 1101111010101101 Convert from (H)exadecimal, (B)inary, (D)ecimal, or (Q)uit? B Enter Number: 101010 DEC: 42 HEX: 2A BIN: 101010 Convert from (H)exadecimal, (B)inary, (D)ecimal, or (Q)uit? D Enter Number: 65535 DEC: 65535 HEX: FFFF BIN: 1111111111111111 Convert from (H)exadecimal, (B)inary, (D)ecimal, or (Q)uit? L Invalid choice, please try again. Convert from (H)exadecimal, (B)inary, (D)ecimal, or (Q)uit? Q Thank you for using the number converter.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started