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

* Computes the interest due the second year of a loan.

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