on up back w3c Fifth International World Wide Web Conference

Mortgage Applet (7)

            for (short mo = 1; mo <= npmts; ++mo) {
                double prinpmt, intpmt = bal * intmo;
                if (mo < npmts)
                    prinpmt = pmt - intpmt;
                else prinpmt = bal;
                bal -= prinpmt;
                msg.append(mo + "\t" + format(intpmt + prinpmt)
                    + "\t" + format(intpmt)
                    + "\t" + format(prinpmt)
                    + "\t" + format(bal) + "\n");
            }
            msgArea.setText(msg.toString());
        }
    }
}


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