Why is this giving me an infinite loop?
<p>I was going through a code used to calculate investments until it has doubled and I received an infinite loop that I can't seem to solve. Can anyone figure out why this is giving me an infinite loop? I've gone through myself but I can't seem to find the problem. The "period" referred is how many times per year the interest is compounded.</p>

<pre><code>double account = 0; //declares the variables to be used
   double base = 0;
   double interest = 0;
   double rate = 0;
   double result = 0;
   double times = 0;
   int years = 0;
   int j;

   System.out.println("This is a program that calculates interest.");
   Scanner kbReader = new Scanner(System.in); //enters in all data  
   System.out.print("Enter account balance: ");
   account = kbReader.nextDouble();
   System.out.print("Enter interest rate (as decimal): ");
   rate = kbReader.nextDouble();

   System.out.println("                    " + "Years to double" + "     " +     "Ending balance");
   base = account;
   result = account;
   for (j=0; j&lt;3; j++){
       System.out.print("Enter period: ");
       times = kbReader.nextDouble();
       while (account &lt; base*2){
           interest = account * rate / times;
           account = interest + base;
           years++;
       }
        account = (((int)(account * 100))/100.0);
       //results
       System.out.print("                         " + i + "               " + account + "\n");
       account = result;
   }
</code></pre>

<p>The code should ask for three "periods", or three different times the entered data is compounded per year (ex annually, monthly, daily etc.)</p>

<p>Thanks a lot!</p>
