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

* Computes the depreciation of an asset using the double-declining balance * method.

* * The depreciation of an asset with an initial cost of $2500 and a salvage * value of $500 over a period of 2 years is calculated. A factor of 2 is used * (the double-declining balance method). * * * @see Code * @see Output */ public class FinanceDdbEx1 { public static void main(String args[]) { double cost = 2500; double salvage = 500; double factor = 2; int life = 24; for (int period = 1; period <= life; period++) { double ddb = Finance.ddb(cost, salvage, life, period, factor); System.out.println("For period " + period + " ddb = " + NumberFormat.getCurrencyInstance().format(ddb)); } } }