0

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

0

sorry just change the pay to payement in the println

Never had so many mistakes in my posts like this :(

Edited by zeroliken: n/a

0

sorry just change the pay to payement in the println

Never had so many mistakes in my posts like this :(

Haha, it's ok I'm use to mistakes...but anyways it now accumulates by 100..but not any other number.

OUTPUT:


Month: 1 Balance: 515.0 Total Payments: 500.0
Month: 2 Balance: 22.725000000000023 Total Payments: 600.0
Month: 3 Balance: -476.934125 Total Payments: 700.0

0

Third mistake in a row tsktsk I must be losing it

payement+=payement

that should do it

Edited by zeroliken: n/a

0

Third mistake in a row tsktsk I must be losing it

payement+=payement

that should do it

haha, thanks for all your help! The end result I just did

pay = pay * month;

:)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.