Question: Java Program Write a program that lets the user choose one of the four choices (Decimal to Binary, Decimal to Hex, etc) and get their

Java Program

Write a program that lets the user choose one of the four choices (Decimal to Binary, Decimal to Hex, etc) and get their string input. Display the output and then allow the user to choose again. Allow the user to clear the screen.

You should have a JavaFX User Interface . You can use any control that youd like for the choice (examples: radiobutton, listview) and you should allow input via textview and output via label. You should have a clear button that clears all data (choices, input and output).

You should use recursion to convert the String data to the appropriate value as described in your book for the exercises 18.21 through 18.24.

You should have a separate method for each conversion that is described in your book In order to break down your work, write and work out your methods first. Then work on the GUI once you have your methods down. Use event listeners. JavaFX with FXML is optional but desired.

Exercies 18.21 18.24 from the book:

18.21 (Decimal to binary) Write a recursive method that converts a decimal number into a binary number as a string. The method header is

public static String dec2Bin(int value)

Write a test program that prompts the user to enter a decimal number and displays its binary equivalent.

18.22 (Decimal to hex) Write a recursive method that converts a decimal number into a hex number as a string. The method header is

public static String dec2Bin(Hex value)

Write a test program that prompts the user to enter a decimal number and displays its hex equivalent.

18.23 (Binary to decimal) Write a recursive method that parses a binary number as a string into a decimal integer. The method header is

public static int bin2Dec(String binaryString )

Write a test program that prompts the user to enter a binary string and displays its decimal equivalent.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!