ehem..anyway just store the value in a separate variable
int payement = pay; System.out.println ("Month: "+ month + " Balance: " + nbalance + " Total Payments: " + pay); while(nbalance>1.00){ double value = nbalance * .015; payement+=100; nbalance = (value+nbalance) - pay; System.out.println ("Month: "+ month + " Balance: " + nbalance + " Total Payments: " + pay); month++; }
That works, but again, the total payments doesn't calculate right..
OUTPUT:
Month: 1 Balance: 515.0 Total Payments: 500.0
Month: 2 Balance: 22.725000000000023 Total Payments: 500.0
Month: 3 Balance: -476.934125 Total Payments: 500.0
>
It's supposed to be 500.0 1000.0 1500.0