Example: Future Value - Adustable Rates

An investment of $10,000 is made. The investment will grow at the rate of 5.1% the first year, with the rate increasing by .1% each year thereafter for a total of 5 years. The future value of the investment is computed.
import com.imsl.finance.*;
import java.text.NumberFormat;

public class fvscheduleEx1 {
    public static void main(String args[]) {
        double principal = 10000.0;
        double[] schedule = {.050, .051, .052, .053, .054};
        double fvschedule;
        
        fvschedule = Finance.fvschedule(principal, schedule);
        System.out.println("After 5 years the $10,000 investment will have " +
        "grown to " + NumberFormat.getCurrencyInstance().format(fvschedule));
    }
}

Output

After 5 years the $10,000 investment will have grown to $12,884.77
Link to Java source.