Future Value helps define the worth of an asset at a specific date. All things being constant, this will help determine if $100 is more valuable than $110 a year from now. Another thing to look at is if you are making $20.00 per hour and in a year you receive a $0.25 cent raise is your value less or more than a year ago?

There are two methods to calculate the future value of an object. The first is by using simple interest. The second is by using compound interest.

## The Simple Interest Method

Simple interest is rarely used. The formula looks like:

FV = PV * (1 + rt)

We are trying to solve for FR so we have three variables that need to be identified. We need to know what the present value is (PV), the interest rate (r) and the duration (t).

Here is how the code looks for simple interest.

public double SimpleInterest(double presentValue, double rate, int time) {

return presentValue * (1 + rate * time);

}

I add the reference to the new Access project and then the following function allows the Console project to call the code.

public double FutureValueSimpleInterest(double presentValue, double rate, int time) {

var algorithm = new FutureValue.General();

return algorithm.SimpleInterest(presentValue, rate, time);

}

The following lines added to the Console project will execute the code. This is added to Main with the other Algorithms we worked on so this is just a snippet of that code.

double presentValue = 20.00;

double rate = 0.10;

int time = 5;

//Future Value

Console.WriteLine(“Future Value: Simple Interest”);

Console.WriteLine(controller.FutureValueSimpleInterest(presentValue, rate, time));

We should be able to follow this pretty easily: $20.00 with a 10% interest rate will have a future value of $30.00 after 5 years.

As always you can check out the code on GitHub. If you were following the project, you got the code before the article.

## Compound Interest Method

Compound interest is commonly used by banks for loans. The difference between compound and simple interest is that with compound interest the interest is charged to the principle and the accrued interest to date. The formula for compound interest is:

FV = PV * (1+r)^t

Similar to simple interest with one significant difference. The difference with compound interest is that (1+r) is to the power of t and not (1+rt).

Here is how the code looks for compound interest.

public double CompoundInterest(double presentValue, double rate, int time)

{

return presentValue * Math.Pow((1 + rate), time);

}

The reference in the Access project looks like:

public double FutureValueCompoundInterest(double presentValue, double rate, int time)

{

var algorithm = new FutureValue.General();

return algorithm.CompoundInterest(presentValue, rate, time);

}

We can use the same variables used in the simple interest algorithm above, and the code will look like this:

Console.WriteLine(“Future Value: Compound Interest”);

Console.WriteLine(controller.FutureValueCompoundInterest(presentValue, rate, time));

We are not able to follow the numbers as easily this time because each year will add interest to the principle, which will change the number we calculate interest on the next year. We take the same $20.00 with a 10% interest over 5 years and end up with $32.21(02.)