(Hex to binary) Write a program that prompts the user to enter a hex digit and displays its corresponding binary number. Here is sample run: Below are the sample outputs: Enter a hex digit: Ger G is an invalid input Enter a hex digit: B Enter The binary value is 1011

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 34SA
icon
Related questions
Question
(Hex to binary) Write a program that prompts the user to enter a hex digit and
displays its corresponding binary number. Here is sample run:
Below are the sample outputs:
Enter a hex digit: Ger
G is an invalid input
Enter a hex digit: Ber
The binary value is 1011
Hint: Implement Scanner and use typecasting,
Declare a main method
Declare a variable to store user input
Implement a check for user input
Use loop to convert the hexadecimal to decimal
Implement a while loop to convert the decimal number to binary
Please submit the following:
1. Your flowchart or logic in your program
2. The entire project folder containing your entire project (That includes .java file) as a
compressed file. (zip)
3. Program output - screenshot
Also,
1. Copy and paste source code to this document underneath the line "your code and
results/output"
2. Include flowchart for your program and logical flow and description
3. Include screenshot or your running program
Transcribed Image Text:(Hex to binary) Write a program that prompts the user to enter a hex digit and displays its corresponding binary number. Here is sample run: Below are the sample outputs: Enter a hex digit: Ger G is an invalid input Enter a hex digit: Ber The binary value is 1011 Hint: Implement Scanner and use typecasting, Declare a main method Declare a variable to store user input Implement a check for user input Use loop to convert the hexadecimal to decimal Implement a while loop to convert the decimal number to binary Please submit the following: 1. Your flowchart or logic in your program 2. The entire project folder containing your entire project (That includes .java file) as a compressed file. (zip) 3. Program output - screenshot Also, 1. Copy and paste source code to this document underneath the line "your code and results/output" 2. Include flowchart for your program and logical flow and description 3. Include screenshot or your running program
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 4 images

Blurred answer