import com.imsl.finance.*; import java.text.NumberFormat; public class irrEx1 { public static void main(String args[]) { double[] pmt = {-4500., -800., 800., 800., 600., 600., 800., 800., 700., 3000.}; double irr = Finance.irr(pmt); NumberFormat nf = NumberFormat.getPercentInstance(); nf.setMaximumFractionDigits(2); System.out.println("After 9 years, the internal rate of return on " + "the cows is " + nf.format(irr)); } }