package com.imsl.test.example.finance; import com.imsl.finance.*; import java.text.NumberFormat; /** *

* Computes the payment on principal the first year of a loan.

* The payment on the principal the first year on a 25 year, $100,000 loan is * calculated. The loan is at 8%. * * * @see Code * @see Output */ public class FinancePpmtEx1 { public static void main(String args[]) { double rate = .08; int per = 1; int nper = 25; double pv = 100000.00; double fv = 0.0; int when = Finance.AT_END_OF_PERIOD; double ppmt = Finance.ppmt(rate, per, nper, pv, fv, when); System.out.println("The payment on the principal the first year " + "of the $100,000 loan is " + NumberFormat.getCurrencyInstance().format(ppmt)); } }