I need to have an outcome like this:
example the user input are principal = 2000, term=6, rate=2%
Period Interest  Total Interest  Total Balanced<br>
    1      6.66            6.66             2006.60 
    2      6.69            13.35           2013.35 
    3      6.71            20.06           2020.06 
    4      6.74            26.80           2026.80 
    5       6.75           33.55           2033.55 
    6       6.78           40.33           2040.33
My code is:
import java.io.*;
public class interest
{
    public static void main(String[] args)throws Exception
    {
        BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(System.in));
        float p, t, r, total;
        int a = 1;
        System.out.println("Enter the amount deposited: ");
        p = Integer.parseInt(bufferedreader.readLine());
        System.out.println("Enter the number of term: ");
        t = Integer.parseInt(bufferedreader.readLine());
        System.out.println("Enter the interest rate(%): ");
        r = Integer.parseInt(bufferedreader.readLine());
        System.out.println("Period \t Interest  Total Interest  Total Balance");
        while ( a <= t)
        {
            System.out.print("   " + a + "\t   ");
            a++;
            {
                float R = (float) (r/100)/t;
                float interest = (float) p * R;
                float totalInt = (float) interest ;
                total = p + totalInt;
                System.out.println(interest + "\t\t" + totalInt + "\t      " + total);
            }
        }
    }
}
but the outcome turns up like this:
Period   Interest  Total Interest  Total Balance
   1       6.6666665        6.6666665         2006.6666
   2       6.6666665        6.6666665         2006.6666
   3       6.6666665        6.6666665         2006.6666
   4       6.6666665        6.6666665         2006.6666
   5       6.6666665        6.6666665         2006.6666
   6       6.6666665        6.6666665         2006.6666
 
     
     
     
     
    