Early Computing 4
Early Computing 4
10/05/24
Source Code:
Import java.util.Scanner;
// opens the class and declares the main method and scanner
// Starts asking for the decimal number unless the word “STOP”
is entered
For (;;) {
If (userInput.equalsIgnoreCase(“STOP”)) {
Try {
String binaryNumber =
Integer.toBinaryString(decimalNumber); // Converts the decimal
number to binary
} catch (NumberFormatException e) {
Scanner.close();
PROOF SCREENSHOTS: