on up back w3c Fifth International World Wide Web Conference

Real Application (part 3)

        System.out.println("payment\ttotal\tinterest principal balance");
        System.out.println("number\tpayment\tpayment\tpayment");
        System.out.println("\t\t\t\t" + bal);
        for (short mo = 1; mo <= npmts; ++mo) {
            double prinpmt, intpmt = bal * intmo;
            if (mo < npmts)
                prinpmt = pmt - intpmt;
            else prinpmt = bal;
            bal -= prinpmt;
            System.out.println(mo + "\t" + format(intpmt + prinpmt)
                + "\t" + format(intpmt)
                + "\t" + format(prinpmt)
                + "\t" + format(bal));
        }
    }
}


Java - An Introductory Language Tutorial (E.A.Johnson)