I am trying to make a program that takes a binary number that the user inputs, and converts it to an int. then it displays it to the user. this is the code i have so far.(it compiles but it doesnt calculate the answer. can anyone help me??
Code:import java.util.Scanner;
public class DanielsonErikA2Q2{
public static void main (String []args){
String binaryInput;
int binaryNumber;
int lastdigit;
int runningTotal =0;
int product;
int preproduct;
int calculation;
int result;
int number;
Scanner keyboard = new Scanner(System.in);
System.out.println("Please enter the binary number you would like to convert to a decimal.");
binaryNumber= keyboard.nextInt();
while(binaryNumber!=-1){
while(binaryNumber>0){
for(int i=1; i>=100; i++)
{
result= (int)Math.pow(2, i);
number= binaryNumber%10;
preproduct= number * result;
product = number * preproduct;
runningTotal = runningTotal + product;
}
System.out.println("The Number as a decimal is " + runningTotal);
}
}
}
}

