Heey,
I'm having a problem with this code. It doesn't want to stop at 0.
public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { double schuld = 100000; double rp = 9.0; double rente; double af = 15000; double sum; int jaar = 1; sum = 0; rente = (schuld/100) * rp; System.out.println("Jaar Schuld Rp Rente Aflossing"); System.out.println(jaar + " " + schuld + " " + rp + " " + rente + " " + af); while (schuld >= 0){ rente = (schuld/100) * rp; schuld = (schuld + rente) - af; jaar++; System.out.println(jaar + " " + schuld + " " + rp + " " + rente + " " + af); if(schuld == 0) schuld = sum; } } }
Can anyone please help me?