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

sorry just change the pay to payement in the println

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

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

Third mistake in a row tsktsk I must be losing it

payement+=payement

that should do it

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;

:)

Good for you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.