This program needs to be written in Java. Along with NO For/while loops, and no methods.
Binary to decimal
Write a program that prompts the user to enter a four binary numbers as a string and displays its corresponding decimal value. Here are sample runs:
Enter a four-digit binary string: 1111
The decimal number for 1111 is 15