package com.imsl.test.example.finance; import com.imsl.finance.*; /** *

* Computes the number of payment periods for a loan.

* Someone obtains a $20,000 loan at 7.25% to buy a car. They want to make $350 * a month payments. Here, the number of payments necessary to pay off the loan * is computed. * * * @see Code * @see Output */ public class FinanceNperEx1 { public static void main(String args[]) { double rate = 0.0725 / 12; double pmt = -350.; double pv = 20000; double fv = 0.; int when = Finance.AT_BEGINNING_OF_PERIOD; double nperiods; nperiods = Finance.nper(rate, pmt, pv, fv, when); System.out.println("Number of payment periods = " + nperiods); } }