package com.imsl.test.example.finance; import com.imsl.finance.*; import java.text.NumberFormat; /** *
* Computes the effective rate from a nominal rate compounded quarterly.
* * In this example the effective interest rate is computed given that the * nominal rate is 6.0% and that the interest will be compounded quarterly. * * @see Code * @see Output */ public class FinanceEffectEx1 { public static void main(String args[]) { double nominalRate = .06; int nper = 4; double effectiveRate; effectiveRate = Finance.effect(nominalRate, nper); NumberFormat nf = NumberFormat.getPercentInstance(); nf.setMaximumFractionDigits(2); System.out.println("The effective rate of the nominal rate, 6.0%, " + "compounded quarterly is " + nf.format(effectiveRate)); } }