Question: Shown here is a function to compute the future value of an investment given the ini investment amount present value, the duration in years, and
Shown here is a function to compute the future value of an investment given the ini investment amount present value, the duration in years, and the annual percentage (growth) rate, APR 2. Function futVall presVal As Double, years As Double, apr As Double ) As Double futVal- presVal Application.WorksheetFunction. Powerl (1+ apr), years) End Function Write a nested for-loop to construct a table of values using the inputs from the given table. Present Value ($) Output Table Location 10000 F15 C10 11 APR() Years) Durations Min Max Increment 10 6 20 0.5 Sub makeTablel Const Anchor As String "C11 Dim aprMin As Double, aprMax As Double, aprinc As Double Dim yrsMin As Double, yrsMax As Double, yrsinc As Double Dim presVal As Double Dim outloc As String aprMin RangelAnchor).Cells(2,2).Value aprMax Range(Anchor).Cells(3,2) Value aprinc Range(Anchor).Cells 4, 2).Value yrsMin . Range(Anchor).cells( 1,Value yrsMax Range(Anchor).CellsValue yrsin. Range(Anchor). Cells ( ),value presVal Range(Anchor)Cellst-2,2)-Value outLoc Range(Anchor),Cells. Value UL corner of output table Dim yrs As Double, apr As Double, tv As Double Dim ic As Integer, ir As Integer apr "-- -. The initial apr value For ir To the initial year value Step_ For icTo Value_ next year value next- - next apr value apr -apr Next Write a for-loop here to annotate the top of the table with each year. The top is row relative to outloc. End Sub
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
