I'm not getting loops to take a new value after each loop?
<p>I'm trying to solve a problem where I try to get my loop to take a new value after every loop. The program is suppose to fine me my Interest payment,principal payment an current balance, doing so my interest is suppose to be less an lesser every time I loop but its only looping the first answer over an over  </p>

<p>Here is the output which the first answer is correct but the other three is           </p>

<pre><code>    Enter Loan Amount:500
    Enter Annual Interest:50
    Total payment:4
    Enter Loan Length :1
    Interest PaymentPrincipal PaymentCurrent Balance
    Interest Payment Principal Payment Current Balance 62.5
    62.5
    62.5
    62.5
</code></pre>

<p>It supposed to be 12.5% of the balance after the first payment.</p>

<pre><code>    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        //variabled decleared
        double rate;
        double payment;
        int amt = 1;
       //input
       System.out.print("Enter Loan Amount:");
        double principal = input.nextDouble();
        System.out.print("Enter Annual Interest:");
        double interest = input.nextDouble();
        System.out.print("Total payment:");//12=monthly,4= quartely,2=semi-annually and 1=annually
        double period = input.nextDouble();
        System.out.print("Enter Loan Length :");
        int length = input.nextInt();

        //proces
        rate = interest / 100;
        double period_rate = rate / period;
          double n = period * length;
        payment = (principal*Math.pow((1+period_rate),n))/n;





        System.out.printf("\n"+"Interest Payment"+"     Principal Payment       "+"         Current Balance     ");

        for(int i=1; i&lt;=n; i++){
        double principal_payment=0;
        double current_balance;
        double payment_interest;

        current_balance=(principal-principal_payment);
         payment_interest=(principal*period_rate);
        principal_payment=(payment-payment_interest);
        principal=current_balance;



         System.out.println(payment_interest+"");

         }
</code></pre>
