pv of cash flows
Visual Basics Code for Future Value of uneven cash flow?
I have a program which user enters bunch of UNEVEN cash flows and I store them in an Array Index, then user enters the interest rate, finally the user selects the time at which the FV is calculated
Since it’s an uneven cash flow, I need to figure out FV for each cash flow then add all of them toger
Formula : FV= PV (1+i)^n
then add x number of cash flows together
Can someone please help with the codes? LIke how to code that and how to extract the info from the array index? THanks a BUNCH!!
It has been way too long since accounting but all of this seems eerily familiar. I wasn’t sure about the formula such as what value will be for i (interst rate?) and what will be for n (time?) but I took a stab at writing something up in VB.NET.
You will want to change the UnevenValues array to contain whatever values need to be in there, this is most likely coming from the user. The interestRate and fvTime will also need to be changed to whatever input values. Hopefully I was close on the formula but with the inputs you should be able to modify this code to get it to work for you.
‘FV= PV (1+i)^n
Dim UnevenValues As Double() = {1, 2, 3, 4, 5}
Dim interestRate As Double = 0.0525
Dim fvTime As Integer = 10
‘Get all of the Future Values
Dim fvValues(UnevenValues.Length – 1) As Double
For i As Integer = 0 To UnevenValues.Length – 1
fvValues(i) = UnevenValues(i) * ((1 + interestRate) ^ fvTime)
Next
‘Add the Future Values together
Dim total As Double = 0
For Each fval As Double In fvValues
total += fval
Next
MessageBox.Show(CStr(total))
Present Value 4 (and discounted cash flow)
|
|
The Quest for Value: A Guide for Senior Managers
$5.63 In this bestselling classic of financial management, G. Bennett Stewart, III, raises and answers these provocative questions:Do dividends matter?Are earnings per share really accurate measures of corporate performance?What is the engine that really drives share prices?More than that, Stewart lays the foundation for EVAr, the financial management and incentive system now in place at nearly 300 comp... |
